Perl special variable it is the "input separator". From the camel (the real one):
"Entirely undefining $/ makes the next line input operation slurp in the remainder of the file as one scalar value." Which is how it was used in the first post. See $\ for the output separator. It is a good idea to 'local' this beast before changing it. http://danconia.org ------------------------------------------------ On Fri, 6 Dec 2002 14:20:01 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > What is $/???? Is this a made up variable or a Perl special variable? I > don't recall coming across it in the learning Perl book. But I have just > started the programming Perl book. > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On > > Behalf Of zentara > > Sent: Friday, December 06, 2002 6:36 AM > > To: [EMAIL PROTECTED] > > Subject: Re: Snagging the last page of a report > > > > > > On Thu, 5 Dec 2002 14:24:03 -0500, [EMAIL PROTECTED] (Paul Kraus) > > wrote: > > > > >>snip "How to seek last 2k?" > > > > Here's a start for you, getting the last 2k of the file. > > Looping and checking for last page break is left up to you. :-) > > > > #!/usr/bin/perl -w > > use strict; > > > > my $filename = shift or die "Usage: $0 file \n"; > > > > # Open the file in read mode > > open FILE, "<$filename" or die "Couldn't open $filename: $!"; > > > > # Rewind from the end of the file until -2k > > seek FILE,0, 2; #go to EOF > > seek FILE,-2048,2; #get last 2k bytes > > > > $/=undef; > > my $tail = <FILE>; > > print "$tail\n"; > > exit; > > > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]