[29564] in Perl-Users-Digest
Perl-Users Digest, Issue: 808 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 30 09:14:14 2007
Date: Thu, 30 Aug 2007 06:14:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 30 Aug 2007 Volume: 11 Number: 808
Today's topics:
Re: Searching in a line <peter@makholm.net>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <jurgenex@hotmail.com>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <lerameur@yahoo.com>
Re: Searching in a line <lerameur@yahoo.com>
Sending a pdf file with perl <bill@ts1000.us>
Re: why warn on undefined $1? <ced@blv-sam-01.ca.boeing.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 30 Aug 2007 04:14:50 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: Searching in a line
Message-Id: <878x7t8xqd.fsf@hacking.dk>
lerameur <lerameur@yahoo.com> writes:
> Hi
> either way I am getting these error messages:
> ./spam2: my: command not found
> ./spam2: line 6: unexpected EOF while looking for matching `"'
> ./spam2: line 10: syntax error: unexpected end of file
Looks like you're trying to use bash af perl interpreter. That
wouldn't work. Did you forgot the #!-line?
//Makholm
------------------------------
Date: Thu, 30 Aug 2007 05:00:25 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188475225.385917.160250@w3g2000hsg.googlegroups.com>
On Aug 30, 12:14 am, Peter Makholm <pe...@makholm.net> wrote:
> lerameur <leram...@yahoo.com> writes:
> > Hi
> > either way I am getting these error messages:
> > ./spam2: my: command not found
> > ./spam2: line 6: unexpected EOF while looking for matching `"'
> > ./spam2: line 10: syntax error: unexpected end of file
>
> Looks like you're trying to use bash af perl interpreter. That
> wouldn't work. Did you forgot the #!-line?
>
> //Makholm
Thanks fo ryour help
I re-wrote the program like you said without #! line.. Doh
here your/my program: (the file.txt file i sin the same directory with
two lines)
12,45,7,435,435,42342,2432;
243,454,324,45,2,4;
~
the program :
#!/usr/bin/perl
my $log = 'file.txt';
open my $fh, '<', $log or die "cannot open '$log': $!\n";
while (<$fh>) {
my $val =(split( /,/,$log))[3]
print $val, "\n";
}
close $fh;
getting compilation error.
New to perl, different then C and Basic
------------------------------
Date: Thu, 30 Aug 2007 05:10:18 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188475818.391736.118250@19g2000hsx.googlegroups.com>
On Aug 30, 12:14 am, Peter Makholm <pe...@makholm.net> wrote:
> lerameur <leram...@yahoo.com> writes:
> > Hi
> > either way I am getting these error messages:
> > ./spam2: my: command not found
> > ./spam2: line 6: unexpected EOF while looking for matching `"'
> > ./spam2: line 10: syntax error: unexpected end of file
>
> Looks like you're trying to use bash af perl interpreter. That
> wouldn't work. Did you forgot the #!-line?
>
> //Makholm
Thanks fo ryour help
I re-wrote the program like you said without #! line.. Doh
here your/my program: (the file.txt file i sin the same directory with
two lines)
12,45,7,435,435,42342,2432;
243,454,324,45,2,4;
~
the program :
#!/usr/bin/perl
my $log = 'file.txt';
open my $fh, '<', $log or die "cannot open '$log': $!\n";
while (<$fh>) {
my $val =(split( /,/,$log))[3]
print $val, "\n";
}
close $fh;
getting compilation error.
New to perl, different then C and Basic
------------------------------
Date: Thu, 30 Aug 2007 05:25:44 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188476744.425854.221160@g4g2000hsf.googlegroups.com>
On Aug 30, 12:14 am, Peter Makholm <pe...@makholm.net> wrote:
> lerameur <leram...@yahoo.com> writes:
> > Hi
> > either way I am getting these error messages:
> > ./spam2: my: command not found
> > ./spam2: line 6: unexpected EOF while looking for matching `"'
> > ./spam2: line 10: syntax error: unexpected end of file
>
> Looks like you're trying to use bash af perl interpreter. That
> wouldn't work. Did you forgot the #!-line?
>
> //Makholm
Thanks fo ryour help
I re-wrote the program like you said without #! line.. Doh
here your/my program: (the file.txt file i sin the same directory with
two lines)
12,45,7,435,435,42342,2432;
243,454,324,45,2,4;
~
the program :
#!/usr/bin/perl
my $log = 'file.txt';
open my $fh, '<', $log or die "cannot open '$log': $!\n";
while (<$fh>) {
my $val =(split( /,/,$log))[3]
print $val, "\n";
}
close $fh;
getting compilation error.
New to perl, different then C and Basic
------------------------------
Date: Thu, 30 Aug 2007 12:28:11 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Searching in a line
Message-Id: <vJyBi.10488$Eh5.3052@trndny06>
lerameur wrote:
> my $log = 'file.txt';
> open my $fh, '<', $log or die "cannot open '$log': $!\n";
> while (<$fh>) {
>
> my $val =(split( /,/,$log))[3]
> print $val, "\n";
>
> }
> close $fh;
>
> getting compilation error.
Well, the indentation gives it away: the my $val=... statement is missing
the trailing semicolon, dude.
> New to perl, different then C and Basic
Put neither of those is accepting syntax errors, either.
jue
------------------------------
Date: Thu, 30 Aug 2007 05:38:49 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188477529.173897.302920@w3g2000hsg.googlegroups.com>
On Aug 30, 12:14 am, Peter Makholm <pe...@makholm.net> wrote:
> lerameur <leram...@yahoo.com> writes:
> > Hi
> > either way I am getting these error messages:
> > ./spam2: my: command not found
> > ./spam2: line 6: unexpected EOF while looking for matching `"'
> > ./spam2: line 10: syntax error: unexpected end of file
>
> Looks like you're trying to use bash af perl interpreter. That
> wouldn't work. Did you forgot the #!-line?
>
> //Makholm
Thanks fo ryour help
I re-wrote the program like you said without #! line.. Doh
here your/my program: (the file.txt file i sin the same directory with
two lines)
12,45,7,435,435,42342,2432;
243,454,324,45,2,4;
~
the program :
#!/usr/bin/perl
my $log = 'file.txt';
open my $fh, '<', $log or die "cannot open '$log': $!\n";
while (<$fh>) {
my $val =(split( /,/,$log))[3]
print $val, "\n";
}
close $fh;
getting compilation error.
New to perl, different then C and Basic
------------------------------
Date: Thu, 30 Aug 2007 05:52:25 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188478345.620472.134180@r34g2000hsd.googlegroups.com>
On Aug 30, 8:28 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> lerameur wrote:
> > my $log =3D 'file.txt';
> > open my $fh, '<', $log or die "cannot open '$log': $!\n";
> > while (<$fh>) {
>
> > my $val =3D(split( /,/,$log))[3]
> > print $val, "\n";
>
> > }
> > close $fh;
>
> > getting compilation error.
>
> Well, the indentation gives it away: the my $val=3D... statement is missi=
ng
> the trailing semicolon, dude.
>
> > New to perl, different then C and Basic
>
> Put neither of those is accepting syntax errors, either.
>
> jue
Indeed...
not getting any errors.
BUt there is no output, when I type >./program_name.pl
it skips two lines and returns to the prompt.
k
------------------------------
Date: Thu, 30 Aug 2007 05:58:43 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188478723.514677.17030@g4g2000hsf.googlegroups.com>
On Aug 30, 8:28 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> lerameur wrote:
> > my $log =3D 'file.txt';
> > open my $fh, '<', $log or die "cannot open '$log': $!\n";
> > while (<$fh>) {
>
> > my $val =3D(split( /,/,$log))[3]
> > print $val, "\n";
>
> > }
> > close $fh;
>
> > getting compilation error.
>
> Well, the indentation gives it away: the my $val=3D... statement is missi=
ng
> the trailing semicolon, dude.
>
> > New to perl, different then C and Basic
>
> Put neither of those is accepting syntax errors, either.
>
> jue
Indeed...
not getting any errors.
BUt there is no output, when I type >./program_name.pl
it skips two lines and returns to the prompt.
k
------------------------------
Date: Thu, 30 Aug 2007 06:02:17 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188478937.834681.154060@22g2000hsm.googlegroups.com>
On Aug 30, 8:28 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> lerameur wrote:
> > my $log =3D 'file.txt';
> > open my $fh, '<', $log or die "cannot open '$log': $!\n";
> > while (<$fh>) {
>
> > my $val =3D(split( /,/,$log))[3]
> > print $val, "\n";
>
> > }
> > close $fh;
>
> > getting compilation error.
>
> Well, the indentation gives it away: the my $val=3D... statement is missi=
ng
> the trailing semicolon, dude.
>
> > New to perl, different then C and Basic
>
> Put neither of those is accepting syntax errors, either.
>
> jue
Indeed...
not getting any errors.
BUt there is no output, when I type >./program_name.pl
it skips two lines and returns to the prompt.
k
------------------------------
Date: Thu, 30 Aug 2007 06:04:35 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188479075.383111.276620@y42g2000hsy.googlegroups.com>
On Aug 30, 8:28 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> lerameur wrote:
> > my $log =3D 'file.txt';
> > open my $fh, '<', $log or die "cannot open '$log': $!\n";
> > while (<$fh>) {
>
> > my $val =3D(split( /,/,$log))[3]
> > print $val, "\n";
>
> > }
> > close $fh;
>
> > getting compilation error.
>
> Well, the indentation gives it away: the my $val=3D... statement is missi=
ng
> the trailing semicolon, dude.
>
> > New to perl, different then C and Basic
>
> Put neither of those is accepting syntax errors, either.
>
> jue
Indeed...
not getting any errors.
BUt there is no output, when I type >./program_name.pl
it skips two lines and returns to the prompt.
k
------------------------------
Date: Thu, 30 Aug 2007 06:08:03 -0700
From: lerameur <lerameur@yahoo.com>
Subject: Re: Searching in a line
Message-Id: <1188479283.801150.212330@50g2000hsm.googlegroups.com>
On Aug 30, 8:28 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> lerameur wrote:
> > my $log =3D 'file.txt';
> > open my $fh, '<', $log or die "cannot open '$log': $!\n";
> > while (<$fh>) {
>
> > my $val =3D(split( /,/,$log))[3]
> > print $val, "\n";
>
> > }
> > close $fh;
>
> > getting compilation error.
>
> Well, the indentation gives it away: the my $val=3D... statement is missi=
ng
> the trailing semicolon, dude.
>
> > New to perl, different then C and Basic
>
> Put neither of those is accepting syntax errors, either.
>
> jue
Indeed...
not getting any errors.
BUt there is no output, when I type >./program_name.pl
it skips two lines and returns to the prompt.
k
------------------------------
Date: Wed, 29 Aug 2007 19:42:42 -0700
From: Bill H <bill@ts1000.us>
Subject: Sending a pdf file with perl
Message-Id: <1188441762.982497.106750@o80g2000hse.googlegroups.com>
In one of my perl scripts I need to send a visitor a pdf file when
they visit a web page. Since the pdf file is not in "public" space on
the server, I need to send it to them instead of using a
"Location: ....". I use MIME:Lite for email pdf's on another site, is
there a similar thing for sending pdf's to a browser or can I use
Mime:Lite?
Bill H
------------------------------
Date: Wed, 29 Aug 2007 19:42:23 -0700
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: why warn on undefined $1?
Message-Id: <1188441743.299144.123410@l22g2000prc.googlegroups.com>
On Aug 29, 1:49 pm, "i...@hotmail.com" <i...@hotmail.com> wrote:
> Consider:
>
> # colors -> colours
> $token = 'colors';
> $token =~ s/or(ed|ing|s)?$/our$1/;
>
> But if $token == 'color', Perl emits a warning: Use of uninitialized
> value in concatenation (.) or string. True enough, $1 is undefined,
> but why bother warning? I mean, my regexp has a '?' in it because I
> expect that sometimes 'color' will not have an ending.
>
> I suspect that the answer is "it's simpler to just warn whenever an
> undefined variable occurs in a string, and it's just not worth it to
> detect the case when such a warning is vacuous. Try 'no warnings'.' I
> can deal with that.
You could add an empty alternative to cause
$1 to match an empty string thus preventing
a warning:
$token =~ s/or(ed|ing|s|)?$/our$1/;
--
Charles DeRykus
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V11 Issue 808
**************************************