[19187] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1382 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 26 06:10:31 2001

Date: Thu, 26 Jul 2001 03:10:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <996142213-v10-i1382@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 26 Jul 2001     Volume: 10 Number: 1382

Today's topics:
    Re: newbie question about arrays <goldbb2@earthlink.net>
    Re: parsing SGML file <bwalton@rochester.rr.com>
    Re: parsing SGML file <bwalton@rochester.rr.com>
    Re: Reading from .htpasswd in script (David Efflandt)
    Re: redirect perl script to another cgi/bin? (David Efflandt)
    Re: redirect perl script to another cgi/bin? (wade)
    Re: Sorting an array of strings by 'closeness' to anoth <goldbb2@earthlink.net>
    Re: Split Question <goldbb2@earthlink.net>
    Re: Strange Side Effects Seemingly from open(PIPE, "cmd (Villy Kruse)
    Re: What am I doing wrong with this command line ? <mbudash@sonic.net>
    Re: What am I doing wrong with this command line ? <james@zephyr.org.uk>
    Re: What am I doing wrong with this command line ? (Eric Bohlman)
    Re: Where are the values stored? (Yves Orton)
    Re: Who can help me about the confused (..) operator? (Eric Bohlman)
    Re: Who can help me about the confused (..) operator? <pne-news-20010726@newton.digitalspace.net>
    Re: Who can help me about the confused (..) operator? (Helgi Briem)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 26 Jul 2001 03:07:53 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: newbie question about arrays
Message-Id: <3B5FC1C9.25FD0D50@earthlink.net>

Lup wrote:
> 
> Ok, plain and simple!
> 
> Easiest way to do this.
> 
> I apologize in adv for such a question, but this is what I need to do.

> I have a file ($hostfile) , which is just a list of IPs.

> I have another file ($usersfile) with the another list of IPs, but
> with more information "tabbed" after each IP (i.e. the corresponding
> UserName, ComputerName, etc.).

> I have to generate a report for my network that will basically open
> the first file/array (@host_array), start with the first IP in the
> list, open the second file/array (@users_array) and find the matching
> IP, and finally print that line, (the corresponding UserName,
> ComputerName, etc.) to a report.  Whew!!!

#! perl -w
use strict;

sub getfile() {
	my $prompt = "What file contains the $_[0]?\n";
	my $file;
	do {
		print $prompt;
		chomp( my $name = <STDIN> );
		next unless length $name;
		unless( open $file, "<", $name ) {
			warn "$name: $!\n";
			undef $file;
		}
	} until( $file || eof(STDIN) );
	$file;
}

my $userdata = getfile("list of users");
my $hostfile = getfile("IP you want to search for");

my %userdata = map {
	chomp;
	my( $ip, @data ) = split /\t/;
	( $ip, \@data );
} <$userdata>;

while( my $ip = <$hostfile> ) {
	my @data = @{$userdata{$ip}};
	print join("<tab>", $ip, @data), "\n";
}

__END__

This code is untested, but is the general format of what you need... see
how it only goes through each file once?

-- 
I need more taglines. This one is getting old.


------------------------------

Date: Thu, 26 Jul 2001 01:26:37 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: parsing SGML file
Message-Id: <3B5F71C8.E546C31C@rochester.rr.com>

Shang-Lin Chen wrote:
> 
> I'm writing a Perl script that will parse an SGML file into a flat
> text file. I read the contents of the SGML file into a string that
> will be written out to the flat file. In the original SGML file, there
> are two lines,
> 
> <command>list</command>
> <args>interface=inter</args>,
> 
> that I want to combine into one line. I tried a regular expression on
> the string storing the contents of the file,
> 
> $myfile =~ s/(<\W*command\W*>)\n/$1/gi;
> 
> but it didn't work. How can I remove the end-of-line character?

"It didn't work" leaves a lot of room for interpretation.  What did you
get? A kernel panic?  Nothing?  What?  Your expression tested on your
data does work, in the sense that $myfile ends up being the data minus
the newline.  Is there a chance your SGML file originated on a system
with a different convention for newline characters?  If so, you might
try replacing \n with [\012\015]+ in your regex and see if that fixes
it.
-- 
Bob Walton


------------------------------

Date: Thu, 26 Jul 2001 01:26:52 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: parsing SGML file
Message-Id: <3B5F71D7.EB213016@rochester.rr.com>

Shang-Lin Chen wrote:
> 
> I'm writing a Perl script that will parse an SGML file into a flat
> text file. I read the contents of the SGML file into a string that
> will be written out to the flat file. In the original SGML file, there
> are two lines,
> 
> <command>list</command>
> <args>interface=inter</args>,
> 
> that I want to combine into one line. I tried a regular expression on
> the string storing the contents of the file,
> 
> $myfile =~ s/(<\W*command\W*>)\n/$1/gi;
> 
> but it didn't work. How can I remove the end-of-line character?

"It didn't work" leaves a lot of room for interpretation.  What did you
get? A kernel panic?  Nothing?  What?  Your expression tested on your
data does work, in the sense that $myfile ends up being the data minus
the newline.  Is there a chance your SGML file originated on a system
with a different convention for newline characters?  If so, you might
try replacing \n with [\012\015]+ in your regex and see if that fixes
it.
-- 
Bob Walton


------------------------------

Date: Thu, 26 Jul 2001 03:48:22 +0000 (UTC)
From: see-sig@from.invalid (David Efflandt)
Subject: Re: Reading from .htpasswd in script
Message-Id: <slrn9lv4o6.n8e.see-sig@typhoon.xnet.com>

On Thu, 26 Jul 2001, Card Flourishes <cardflourishes@f2s.com> wrote:
> Is this possible? How so...
> 
> Sorry for the newbie question,

You read it like any other text file.  It typically has to have read
permission for 'others' for the webserver to read it, but if it is
somebody elses and they give it 604 permission you might or might not be
able to read it depending upon whether you are in the same group.

Of course the passwords in it should be crypted if your OS has crypt().

See:  perldoc -f open    

-- 
David Efflandt  (Reply-To is valid)  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


------------------------------

Date: Thu, 26 Jul 2001 04:19:34 +0000 (UTC)
From: see-sig@from.invalid (David Efflandt)
Subject: Re: redirect perl script to another cgi/bin?
Message-Id: <slrn9lv6il.n8e.see-sig@typhoon.xnet.com>

On Wed, 25 Jul 2001 12:40:58 -0600, dw <dw@dw.com> wrote:
> If I do not have access to a local  cgi/bin and want to use perl on some web
> pages can I define a remote cgi/bin?  if so how?

Yes by using a full URL to the CGI script.  Do you have a Perl question?

-- 
David Efflandt  (Reply-To is valid)  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


------------------------------

Date: 25 Jul 2001 23:42:02 -0700
From: jjchen@alumni.ice.ntnu.edu.tw (wade)
Subject: Re: redirect perl script to another cgi/bin?
Message-Id: <4259465b.0107252242.1cbd31b9@posting.google.com>

"dw" <dw@dw.com> wrote in message news:<9jn3o1$8ob$1@centralnews1.Central.Sun.COM>...
> If I do not have access to a local  cgi/bin and want to use perl on some web
> pages can I define a remote cgi/bin?  if so how?
> 
> thx

in HTML...

<FORM action="SOME_WEB_ADDR/cgi-bin/YOUR-CGI-HERE">

or, you need to change the "scriptalias" setting in your APACHE's config file.


------------------------------

Date: Thu, 26 Jul 2001 02:02:52 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Sorting an array of strings by 'closeness' to another string
Message-Id: <3B5FB28C.947C1EB9@earthlink.net>

Jasper McCrea wrote:
> 
> jbp wrote:
> >
> > At Tue, 24 Jul 2001 12:10:44 +0100, Jasper McCrea said:
> > >Jasper McCrea wrote:
> > >>
> > >> jbp wrote:
> > >> >
> > >
> > >>
> > >> Actually, this method should really bias towards a single typo
> > >> better (eg, if one letter was z when it should have been a, the
> > >> counter sub would return a big ish diff, bigger than if all the
> > >> letters were just one off). This might be done by $ascii_diff *=
> > >> 100, or something. Not sure.
> > >
> > >Thinking about this a bit more, and what you really want, I think,
> > >is a method that returns based on bad typo on a QWERTY keyboard.
> > >
> > >so you'd get
> > >
> > >%qwerty = { a => { a => 0,
> > >                   b => 5,
> > >                   c => 3,
> > >                   d => 2,
> > >                   e => 2,
[snip]
> > >$qwerty_diff = $qwerty{$your_letter}{$word_letter};
> > >
> > >and total that for each letter of the words.
> > >(there's a good exercise in here of writing a sub to work out the
> > >$qwerty_diff knowing the keyboard 'coordinates' of each key, but I
> > >can't be arsed right now).
> >
> > I can :)
> >
> > make_qwerty_map();
> > make_distance_map();
> >
> > sub make_qwerty_map
> > {
> >         $keyboard{a}{'x'} = 0;
[snip :)]
> >         $keyboard{z}{'y'} = 0;
> > }
> >
> > sub make_distance_map
> > {
[snip]
> Aha, lunchtime came around, and so could I.
> 
> I did it slightly differently..
> 
> my @keys = ( [ qw(q w e r t y u i o p) ],
>              [ qw(a s d f g h j k l)   ],
>              [ qw(z x c v b n m)       ]);

I would put in numbers and symbols, and at least try to match how my
keyboard looks (the keys aren't in square columns, but diagonals).

my @keys = ( [qw( 1 2 3 4 5 6 7 8 9 0 - = ) ],
             [ qw( q w e r t y u i o p [ ] )],
             [  qw( a s d f g h j k l ; ' ) ],
             [   qw( z x c v b n m , . / )  ]);

> 
> my %positions;
> my %qwerty;
> 
> my $y = 0;
> foreach my $rowref (@keys) {
>   my $x = 0;
>   foreach my $letter (@$rowref) {
>     $positions{$letter} = [$x, $y];
>     ++$x;
>   }
>   ++$y;
> }

Hmm.  This doesn't exactly take into account that lower rows are further
to the right than higher rows, nor does it take into account shift.  I
would do it as:

for my $y (0 .. $#keys) {
	my $row = $keys[$x];
	for my $x (0 .. $#$row) {
		$positions{$$row[$y]} = [$x + $y*(3/7), $y, 0];
	}
}
$positions{"`"} = [-1, 0, 0];
$positions{"\b"} = [ $positions{"="}[0]+1, 0, 0 ];
$positions{"\t"} = [ $positions{"q"}[0]-1, 1, 0 ];
$positions{"\n"} = [ $positions{"'"}[0]+1.5, 1.5, .5 ];
$positions{"\\"} = [ $positions{"/"}[0]+2, 3, 0 ];

for( "A" .. "Z" ) {
	$positions{$_} = [ @{$positions{lc $_} ];
	$positions{$_}[2] = 1;
}
while( my ($k,$v) = each %{{qw X
	` ~ 1 ! 2 @ 3 # 4 $ 5 % 6 ^ 7 & 8 * 9 ( 0 ) - _ = +
	[ { ] } ; : ' " , < . > / ? \ | X}} ) {
	$positions{$k} = [ @{$positions{$v} ];
	$positions{$k}[2] = 1;

I pick 3/7 because it's between 1/2 and 1/3, since neither the number 2
nor the letter w are quite lined up over the letter z (on my keyboard,
anyway).

> my @letters;
> push @letters, @$_ foreach @keys;
> 
> foreach my $first (@letters) {
>   foreach my $second (@letters) {
>     my $x_diff_sq = (${$positions{$first}}[0] -
> ${$positions{$second}}[0]) ** 2;
>     my $y_diff_sq = (${$positions{$first}}[1] -
> ${$positions{$second}}[1]) ** 2;

Too many braces, plus mine has a z distance:
foreach my $a (@letters) { foreach my $b (@letters) {
	my $d;
	for(0..2) {
		$d += ( $position{$a}[$_] - $position{$b}[$_] ) ** 2;
	}
	$packard_bell_1531{$a}{$b} = sqrt( $d );
}

>     $qwerty{$first}{$second} = int sqrt( $x_diff_sq + $y_diff_sq );
>   }
> }
> 
> I used an int root squared distance between the keys, as you can see.

I would leave out the int, since numbers are stored as floats internally
anway.

> But it gives pretty similar results to yours. And if anyone wants to
> adapt to different keyboards, it's easy, too.

Mine isn't *too* hard to adapt either... it's the keys which aren't in
the basic pattern which are annoying, and doing shift/nonshift for the
number keys which may be annoying (like the grave/tidle, and tab keys,
which are to the left of the 1 and q keys, and the backslash/
vertical-bar key which to the right of my right shift key).

The thing is, not all qwerty keyboards are created equal.

-- 
I need more taglines. This one is getting old.


------------------------------

Date: Thu, 26 Jul 2001 00:31:28 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Split Question
Message-Id: <3B5F9D20.E23FEF22@earthlink.net>

Mark Riehl wrote:
> 
> All - I'm trying to parse a CSV file (that originated as an Excel
> file), here's a sample line:
> 
> VALID,,102, 1051,2001-04-03 17:22:00.36,2001-04-03 17:22:00.36,...
> (total of 42 records per line).  I'm really interested in only the
> first 10 fields per line.
> 
> and I'm using the following line to split it up:
> 
> @array = split(',', $_);
> 
> However, some of the lines in second field contain comments that
> contain newlines like this:
> 
> VALID,TEXT HERE\n ANOTHER LINE OF COMMENT\n,102, 1051,2001-04-03
> 17:22:00.36,2001-04-03 17:22:00.36,...

Are you sure about this?  This doesn't seem like valid CSV data.
Surely Excell would be more likely to produce:
VALID,"TEXT HERE
 ANOTHER LINE OF COMMENT
",102, 1051,2001-04-03 17:22:00.36,2001-04-03 17:22:00.36,...

With appropriate quotes...

> It appears that the split is stopping on these premature newlines, and
> getting confused.
> 
> Is there a way to force split to ignore these newlines?  Can I use the
> LIMIT argument for split to make sure that I grab the right number of
> records (42) each time - this way, I'm getting a complete line?
> 
> Thanks for the help,
> Mark

The problem isn't split seeing the newlines, it's whatever method is
reading in data.

If you can get Excel to produce valid CSV data, with quotes around
newlines, then you can use Text::CSV_XS, as follows:

use Text::CSV_XS;
my $csv = Text::CSV_XS->new;
while( <INPUT> ) {
	chomp;
	until( $csv->parse($_) or eof ) {
		$_ .= "\n" . <INPUT>;
	}
	if(!$csv->status) {
		die "Unexpected eof: partial line <" .
			$csv->error_input() . "> not valid.\n";
	}
	my @array = ($csv->fields)[0..9];
	# process here.
}

-- 
I need more taglines. This one is getting old.


------------------------------

Date: 26 Jul 2001 08:13:08 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Strange Side Effects Seemingly from open(PIPE, "cmd 2>&1 |")
Message-Id: <slrn9lvk8j.mf6.vek@pharmnl.ohout.pharmapartners.nl>

On 25 Jul 2001 12:28:38 -0700,
    Chris Mollo <cmollo@checkfree.com> wrote:


>Using Perl version 5.005_03 on AIX.
>
>Using the well-known method of capturing stdout & stderr
>from an application that is launched via a Perl script:
>
>   $pid = open(APPL, "$app 2>&1 |") or die...;
>   while (<APPL>)
>   {
>     :
>     :
>   }
>   close(APPL) or print...;
>
> ...
>
>Anybody ever seen something like this before?
>


Not realy, but I would not think it a good idea to direct stderr
into the pipe as well.  If the $app ever writes to the standard error
stream, then you won't have any control where these message will
occur in the input you are reading from the pipe.  That is one of
the reasons the error stream and the standard output stream is usualy
kept separate in the first place.



Villy


------------------------------

Date: Thu, 26 Jul 2001 02:08:44 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: What am I doing wrong with this command line ?
Message-Id: <mbudash-5C6DFC.19084525072001@news.sonic.net>

In article <Y4i2TTP3B2X7EwtR@gratiano.zephyr.org.uk>, James Coupe 
<james@zephyr.org.uk> wrote:

> In message <vbG77.111898$E4.3052502@amsnews02.chello.com>, Ken Laird
> <kenlaird@yahoo.com> writes
> >So I'm trying something like this
> >
> >perl -e 'for (`ls -la`) {next if /file2/;print}'
> >
> >but it doesn't work.
> 
> Irrespective of whether this would do what you want anyway, you might
> want to put a semi-colon in after your print statement.

he might, but he doesn't need to (either way compiles)... it'd just be 
good form, kinda like using your turn signal even when there's noone 
around: then you won't forget when people *are* around...
 
my .02
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


------------------------------

Date: Thu, 26 Jul 2001 03:05:32 +0100
From: James Coupe <james@zephyr.org.uk>
Subject: Re: What am I doing wrong with this command line ?
Message-Id: <AMkw+aYsr3X7Ew9d@gratiano.zephyr.org.uk>

(Following up to myself, sorry.)

In message <Y4i2TTP3B2X7EwtR@gratiano.zephyr.org.uk>, James Coupe
<james@zephyr.org.uk> writes
>Irrespective of whether this would do what you want anyway, you might
>want to put a semi-colon in after your print statement.

Having received an e-mail on this subject, I'd emphasise the use of the
word "might" which wasn't intended to suggest it was necessary.

-- 
James Coupe                                                PGP Key: 0x5D623D5D
        "Surely somewhere out there there's a woman who's        EBD690ECD7A1F
        been sodomized by her father and is capable of           B457CA213D7E6
        composing a few coherent sentences on the subject."     68C3695D623D5D


------------------------------

Date: 26 Jul 2001 02:56:21 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: What am I doing wrong with this command line ?
Message-Id: <9jo0sl$nf6$4@bob.news.rcn.net>

Michael Budash <mbudash@sonic.net> wrote:
> In article <Y4i2TTP3B2X7EwtR@gratiano.zephyr.org.uk>, James Coupe 
> <james@zephyr.org.uk> wrote:

>> In message <vbG77.111898$E4.3052502@amsnews02.chello.com>, Ken Laird
>> <kenlaird@yahoo.com> writes
>> >So I'm trying something like this
>> >
>> >perl -e 'for (`ls -la`) {next if /file2/;print}'
>> >
>> >but it doesn't work.
>> 
>> Irrespective of whether this would do what you want anyway, you might
>> want to put a semi-colon in after your print statement.

> he might, but he doesn't need to (either way compiles)... it'd just be 
> good form, kinda like using your turn signal even when there's noone 
> around: then you won't forget when people *are* around...

Strictly speaking, omitting the semicolon *is* acceptable form, since in 
Perl semicolons are statement *separators* rather than statement 
*terminators*; they're part of the syntax for stringing statements 
together into blocks, not part of the syntax of the statements themselves 
(things are different in C).  Therefore, the last statement in a block 
doesn't need a semicolon to follow it, any more than the last item in a 
literal list *needs* a comma to follow it.  Nonetheless, a trailing 
semicolon or comma saves a little bit of work when you find yourself 
adding a new statement to the block or a new item to the list, and since 
that little bit of work is easy to overlook, doing so is a stylistic 
nicety.



------------------------------

Date: 26 Jul 2001 01:22:10 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: Where are the values stored?
Message-Id: <74f348f7.0107260022.1d44adfa@posting.google.com>

ebohlman@omsdev.com (Eric Bohlman) wrote in message news:<9jn4eh$3qj$1@bob.news.rcn.net>...
> Jonas Nilsson <nospam.jonni@ifm.liu.se> wrote:
> > Try this:

<SNIP>

> >  I know that use strict; tells you something like: Can't use string ("First
> > value") as a HASH ref while "strict refs" in use at D:\Slask\clpm002.pl line
> > 6.
> 
> It's as the message says.  $hash{A} contains the literal string "First
> value" which is used as a symbolic reference to a hash whose name is what
> the symbol table would contain if you could actually use a variable name
> called "%First value".  That hash has one key, B, whose value is "Second
> value".  If you had written "Firstvalue" without a space, you'd have 
> created a hash variable whose name you could actually use, and you'd find 
> that $Firstvalue{B} was "Second value".

Hmm, very intetresting.  So because its not running under strict a new
hash with a space in its name is created?  But this is not accessable
except through something like %{'First value'}?  Is that right?

Seems like a damn good argument to always 'use strict'.  Not like we
need more reasons but....  :-)

Yves


------------------------------

Date: 26 Jul 2001 02:45:42 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Who can help me about the confused (..) operator?
Message-Id: <9jo08m$nf6$3@bob.news.rcn.net>

MMX166+2.1G HD <no@mail.addr> wrote:
> On 23 Jul 2001 03:27:06 GMT, in comp.lang.perl.misc
> ebohlman@omsdev.com (Eric Bohlman) wrote:
>>[please post you comments *after* the stuff you're commenting on.  I had 
>>to rearrange things so my reply would make sense in context]
> is it OK now?sorry I had not heard of the rule of this order, I used
> to let my Agent decide who is first :)

Yep, it's OK now; you put the quoted stuff before your reply and (*very* 
important!) you trimmed down the quoted stuff to the minimum necessary to 
provide context.



------------------------------

Date: Thu, 26 Jul 2001 08:03:39 +0200
From: Philip Newton <pne-news-20010726@newton.digitalspace.net>
Subject: Re: Who can help me about the confused (..) operator?
Message-Id: <6navlt0bou65hucofgm5vddbh6dstrokjm@4ax.com>

On 26 Jul 2001 02:45:42 GMT, ebohlman@omsdev.com (Eric Bohlman) wrote:

> MMX166+2.1G HD <no@mail.addr> wrote:
> > On 23 Jul 2001 03:27:06 GMT, in comp.lang.perl.misc
> > ebohlman@omsdev.com (Eric Bohlman) wrote:
> >>[please post you comments *after* the stuff you're commenting on.  I had 
> >>to rearrange things so my reply would make sense in context]
> > is it OK now?sorry I had not heard of the rule of this order, I used
> > to let my Agent decide who is first :)
> 
> Yep, it's OK now; you put the quoted stuff before your reply and (*very* 
> important!) you trimmed down the quoted stuff to the minimum necessary to 
> provide context.

Now, for extra points, add a blank line between the quoted stuff and
your reply, as Eric and I did. I find that makes things more readable,
and it's easier to separate who said what.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


------------------------------

Date: Tue, 24 Jul 2001 12:16:56 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Who can help me about the confused (..) operator?
Message-Id: <3b5d667d.99758735@news.isholf.is>

On Tue, 24 Jul 2001 08:29:47 +0800, MMX166+2.1G HD
<no@mail.addr> wrote:

>btw:what a strange complex signature. I see it in many posts. Is it
>used for a special "perl" news reader? what's that? Agent?
>--
>On Sat, 21 Jul 2001 04:55:03 GMT, in comp.lang.perl.misc
>mjd@plover.com (Mark Jason Dominus) wrote:
>
>>@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
>>@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
>>($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
>>close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
>
This is technically known as a JAPH.  

What is a JAPH?

From the Perl FAQ:
http://www.perlfaq.com/cgi-bin/view?view_by_id=98

<START QUOTE>
JAPH stands for Just Another Perl Hacker. It is a short Perl
program that prints the string "Just Another Perl Hacker",
usually in a fun, remarkable or obscure way. The history of
JAPHs started in the early 1990s, when Randal Schwartz used
a lot of them in Usenet signatures. JAPHs from the 1990 era
can be found at http://www.perl.com/CPAN-local/misc/japh. 
SYNOPSIS
    local $, = " ";
    print reverse "Hacker", "Perl", "Another", "Just";
DESCRIPTION
If a JAPH is used as a Usenet signature, it ought to fit in
a 4x80 frame. 
<END QUOTE>
Regards,
Helgi Briem


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 V10 Issue 1382
***************************************


home help back first fref pref prev next nref lref last post