[17677] in Perl-Users-Digest
Perl-Users Digest, Issue: 5097 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 13 00:10:29 2000
Date: Tue, 12 Dec 2000 21:10:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976684213-v9-i5097@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 12 Dec 2000 Volume: 9 Number: 5097
Today's topics:
Re: Printing Vertically <schmelter_tim@hotmail.com>
Re: Printing Vertically <jeffp@crusoe.net>
Re: Printing Vertically <jeffp@crusoe.net>
Re: Printing Vertically (Chris Fedde)
Re: Printing Vertically <jeffp@crusoe.net>
Re: Printing Vertically (Tad McClellan)
Re: Problem using Image::Size on a webserver <iltzu@sci.invalid>
Redirection and variables <Xbtrservices@yahoo.comX>
Re: regex, s and m, dice and elephants <mikek@worldwebserver.com>
Re: Search and Display - Need assistance (Richard Zilavec)
Re: srand() for CGI fallenang3l@my-deja.com
Re: Tabs and the M^ thing... (Richard Zilavec)
Virtual Addressing <rucus20@hotmail.com>
Win32 Internet Shortcut Properties jeffhenke@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 13 Dec 2000 02:26:32 GMT
From: "Tim Schmelter" <schmelter_tim@hotmail.com>
Subject: Re: Printing Vertically
Message-Id: <s7BZ5.32446$6e3.1493464@news3.aus1.giganews.com>
"K6" <blnukem@hotmail.com> wrote in message
news:916bmg$ht1$1@news.monmouth.com...
> Hi All
>
> I've run into a problem, I need to print a value vertically instead of
> normal horizontal
> any ideas?
>
> Thanx
> K6
>
print join( "\n", split//, "Hello, World!" );
--
Tim Schmelter
schmelter_tim@hotmail.com
------------------------------
Date: Tue, 12 Dec 2000 21:40:43 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Printing Vertically
Message-Id: <Pine.GSO.4.21.0012122131480.19179-100000@crusoe.crusoe.net>
On Dec 13, Tim Schmelter said:
>"K6" <blnukem@hotmail.com> wrote in message
>news:916bmg$ht1$1@news.monmouth.com...
>> Hi All
>>
>> I've run into a problem, I need to print a value vertically instead of
>> normal horizontal
>> any ideas?
>
>print join( "\n", split//, "Hello, World!" );
Let's play golf. Assuming the variable is $_, we have...
print join"\n",split//;
That's got 23.
formline("^~~\n",$_);print$^A;
Aww, that's too long, with 30. But what about...
format=
^~~
$_
.
write;
Including 4 newlines (which ARE required), that comes to 24. Oh well.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
PerlMonks - An Online Perl Community http://www.perlmonks.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
------------------------------
Date: Tue, 12 Dec 2000 21:45:34 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Printing Vertically
Message-Id: <Pine.GSO.4.21.0012122144510.19179-100000@crusoe.crusoe.net>
On Dec 12, Jeff Pinyan said:
>On Dec 13, Tim Schmelter said:
>
>>print join( "\n", split//, "Hello, World!" );
>
> print join"\n",split//;
>
>That's got 23.
>
> formline("^~~\n",$_);print$^A;
>
>Aww, that's too long, with 30. But what about...
>
> format=
> ^~~
> $_
> .
> write;
>
>Including 4 newlines (which ARE required), that comes to 24. Oh well.
Here's another method:
s/(?<!^)/\n/g;print;
weighing in at only 20.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
PerlMonks - An Online Perl Community http://www.perlmonks.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
------------------------------
Date: Wed, 13 Dec 2000 02:50:19 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Printing Vertically
Message-Id: <LtBZ5.202$B9.188568576@news.frii.net>
In article <916bmg$ht1$1@news.monmouth.com>, K6 <blnukem@hotmail.com> wrote:
>Hi All
>
>I've run into a problem, I need to print a value vertically instead of
>normal horizontal
>any ideas?
>
You could do it in postscript!
print <<end
/Times-Roman findfont
30 scalefont setfont
72 400 moveto
270 rotate
(Hello World) show
showpage
end
--
This space intentionally left blank
------------------------------
Date: Tue, 12 Dec 2000 22:12:52 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Printing Vertically
Message-Id: <Pine.GSO.4.21.0012122212200.19179-100000@crusoe.crusoe.net>
Oh, here's the shortest I've come up with now:
s/./$&\n/sg;print;
18 chars.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
PerlMonks - An Online Perl Community http://www.perlmonks.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
------------------------------
Date: Tue, 12 Dec 2000 21:55:26 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Printing Vertically
Message-Id: <slrn93dspe.17v.tadmc@maxim.metronet.com>
K6 <blnukem@hotmail.com> wrote:
>
>I've run into a problem, I need to print a value vertically instead of
>normal horizontal
>any ideas?
Lay down as it is coming out of the printer.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Dec 2000 02:27:49 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Problem using Image::Size on a webserver
Message-Id: <976674272.26866@itz.pp.sci.fi>
In article <4a2bf0ff5eg.soper@soundhouse.co.uk>, Geoff Soper wrote:
>directory. Does it look at the use statements before doing anything else?
Yes.
>If that's the case how can I use that module without proper access to the
>server's Perl installation?
>
[snip]
>
>$require_dir = '/home/soundh/cgi-bin/required';
>
>if ($require_dir ne '') {
> push(@INC, $require_dir);
>}
Closest solution to your original:
BEGIN {
$require_dir = '/home/soundh/cgi-bin/required';
if ($require_dir ne '') {
push(@INC, $require_dir);
}
}
More elegant solution:
use lib '/home/soundh/cgi-bin/required';
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens to
answer a question you've asked, that's incidental." -- nobull in clpm
------------------------------
Date: Tue, 12 Dec 2000 22:45:24 -0500
From: TSR <Xbtrservices@yahoo.comX>
Subject: Redirection and variables
Message-Id: <1frd3tossgtiacasis8vs3h4u54alum0d2@4ax.com>
I am trying to solve what I hope is a simple problem. I'll try to
make the explanation simple.
Program A calls Program B. I want to add some scripting in the
middle. Now Program A calls Perl Script calls Program B. Program A
POSTs data and Program B GETs data. When I add the Perl Script in the
middle, how can I transfer the POSTed data from Program A through Perl
Script to Program B without any user interaction in the Perl Script?
BTW, I have no control over Program A or Program B.
More info:
I'm currently building a redirect using
print
$query->redirect('http://www.test.com/ProgramB?color1=red&color2=blue')
This works, however there are some circumstances where the length
could be longer than is allowed for a URL. This is why I am looking
for a better method.
Thanks
Xbtrservices@yahoo.comX (remove X's)
------------------------------
Date: Wed, 13 Dec 2000 02:26:35 GMT
From: Mike King <mikek@worldwebserver.com>
Subject: Re: regex, s and m, dice and elephants
Message-Id: <3A36DDAA.67370C6C@worldwebserver.com>
Bernard El-Hagin wrote:
>
> On Thu, 07 Dec 2000 14:23:56 GMT, Anthony Bouvier
> <anthony@notsoevil.com> wrote:
>
> [snip]
>
> >Though I do not know what your recent snippity attitude stems from, I do
> >appreciate your -earlier- assistance.
>
> You have a funny way of showing your appreciation to one of the most
> helpful people in this NG.
While he may be helpful, I do concur that his comments to Anthony were
"snippity". One can be helpful and snippity at the same time. And I do
believe Anthony said he appreciated Tad's assistance.
-Mike K.
------------------------------
Date: Wed, 13 Dec 2000 04:52:55 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: Search and Display - Need assistance
Message-Id: <3a36feb3.435514945@news.tcn.net>
On Tue, 12 Dec 2000 16:16:53 GMT, msalerno@my-deja.com wrote:
>I need to search the /etc/passwd file for usernames and show all of the
>names that match the search criteria. I am still new at this and I am
>pretty sure that perls grep does not do what I need it to do. I am not
>100% sure what I need to use.
This is just an idea.....
# make sure you have something to match
die "$0 MatchThis\n" unless(length $ARGV[0]);
open(IN, "< /etc/passwd");
# read each line of the passwd file
for(<IN>) {
# usernames containing
if(/^.*?$ARGV[0]:/) {
my @tmp = split(/:/, $_);
# create a hash of arrays
$found{$tmp[0]} = \@tmp;
}
}
close(IN);
for(keys %found) {
# print the name field
print $found{$_}->[4] . "\n";
}
Not sure if this is truly what you want but I think its a good start,
hope it helps.
--
Richard Zilavec
rzilavec@tcn.net
------------------------------
Date: Wed, 13 Dec 2000 01:56:52 GMT
From: fallenang3l@my-deja.com
Subject: Re: srand() for CGI
Message-Id: <916l11$hm9$1@nnrp1.deja.com>
In article <915ilt$isv$1@nnrp1.deja.com>,
sluppy <sluppy@my-deja.com> wrote:
> In article <3A35EEEE.23685E63@xmission.com>,
> fozz@xmission.com wrote:
> > Ahh, RTFM. The POD documentation for srand() gives an excellent
> example:
> >
> > srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`);
> >
> > Nice.
>
> Thanks for the reply. That's a good idea to use the IP. BTW, I
> did "RTFM" before posting and saw the line of code you quoted above.
It
> didn't help me much being on a Windows system; perhaps there is a
> Windows equivalent?
>
> Thanks again.
>
> --Tim
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Try:
srand (time() ^ ($$ + ($$ << 15)));
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 13 Dec 2000 05:03:51 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: Tabs and the M^ thing...
Message-Id: <3a37021c.436387385@news.tcn.net>
On Wed, 13 Dec 2000 00:15:45 -0000, Chris Stith
<mischief@velma.motion.net> wrote:
>
>A nice one-liner, but it doesn't get rid of tabs, or am I missing
>something?
>
Nope, your correct, I missed that part.
>
>perl -i.bak -pe 'tr/\t\r/ /d' *.pl
Will this line replace the \r chars with a space too, I will have to
this tonight.
--
Richard Zilavec
rzilavec@tcn.net
------------------------------
Date: Mon, 11 Dec 2000 13:07:37 -0800
From: "Rucus20" <rucus20@hotmail.com>
Subject: Virtual Addressing
Message-Id: <t3dqr0oi15una8@corp.supernews.com>
Hello, first off thanks for reading this.
Im a newbie at sockets and perl for web.
I want to create a program that uses a host computer to send chat requests
and create a virtual type of addressing. Like IP addresses but different
ok example
say that the 127.0.0.1 protocol is my IP #
now i want the address to represent the ip the computer # on my net work
like but don't want the colons or maybe like 127.0.0.1@Computer39
email me with questions i have no clue on what im writing about. THe best i
could say is maybe network screennames or handles.
rucus20@hotmail.com
------------------------------
Date: Wed, 13 Dec 2000 02:27:51 GMT
From: jeffhenke@my-deja.com
Subject: Win32 Internet Shortcut Properties
Message-Id: <916mr1$j47$1@nnrp1.deja.com>
Is there any way to obtain the URL that an internet shortcut points
to. Since internet shortcuts are files, I could open the file and read
the "BASE URL=" line, but that seems like a lot of extra processing and
overhead. Is there an eaiser way?
JH
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 5097
**************************************