[17104] in Perl-Users-Digest
Perl-Users Digest, Issue: 4516 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 4 09:10:26 2000
Date: Wed, 4 Oct 2000 06:10:15 -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: <970665015-v9-i4516@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 4 Oct 2000 Volume: 9 Number: 4516
Today's topics:
Re: POST with variable data <lkh@class.class.lviv.ua>
Re: problems to install perl module <stig@palmquist.org>
Re: problems to install perl module <thunderbear@bigfoot.com>
Re: reading a secret <lists@a1.org.uk>
Re: Remote execution (rsh) of Perl script (hanging proc <toralf@kscanners.com>
Re: Result of functions in child processes <Torsten.Schindler@ccc.uni-erlangen.de>
Retrieve info from cookie?? <abel@inlander.es>
Re: Retrieve info from cookie?? (Rafael Garcia-Suarez)
Retrive info from a cookie??? <abel@inlander.es>
Re: Retrive info from a cookie??? <anders@wall.alweb.dk>
Serial-Timeout on Solaris <schuette@compoint.de>
Re: Serial-Timeout on Solaris <elaine@chaos.wustl.edu>
Simultaneous file access and FLOCK? <lkh@class.class.lviv.ua>
Re: Simultaneous file access and FLOCK? nobull@mail.com
Re: Simultaneous file access and FLOCK? <lkh@class.class.lviv.ua>
Re: some questions <jeffp@crusoe.net>
Re: The match operator & variables containing regexp-ch <toralf@kscanners.com>
what on is correct??? <tigz@ntlworld.com>
Re: what on is correct??? nobull@mail.com
Re: what on is correct??? <anders@wall.alweb.dk>
Re: what on is correct??? <tigz@ntlworld.com>
Re: what on is correct??? <anders@wall.alweb.dk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 04 Oct 2000 14:10:05 +0300
From: Victor Koldun <lkh@class.class.lviv.ua>
Subject: Re: POST with variable data
Message-Id: <39DB100D.CF8756FA@class.class.lviv.ua>
You should include what you print into double quotes, not single quotes.
Otherwise your $variable will be printed as $variable, not as what is
contained in it.
(well im rather new to it myself so sorry if it doznt work :)
Yaros
briceman@my-deja.com wrote:
> I am trying to POST to another cgi program using
> an input type whose value is set from a
> $variable. The param is always null on the
> called program. If the input value is explicitly
> set it works fine.
>
> print '<CENTER><form method=POST action=/cgi-
> bin/info.cgi><input name=aaaa type=hidden
> value="$site"><input name=action type=hidden
> value="delete"><BR><BR> <input type=submit
> value="Do something here"></CENTER>';
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: 04 Oct 2000 10:37:34 +0200
From: Stig Palmquist <stig@palmquist.org>
Subject: Re: problems to install perl module
Message-Id: <m34s2tt31t.fsf@dubbi.a.sol.no>
"Bo Pan" <bpan99@yahoo.com> writes:
> Hello,
> I am trying to install XML:Parser on my SGI machine, (IRIX 6.5). As I
> do not have cc compiler,
> I installed gcc. But when ever I try 'perl Makefile.PL', makefile
> generated still uses cc as
> compiler, and CFlag includes -n32, mip3, etc.
> What should I do to make the Makefile use gcc?
> Thanks in advance.
ln -s /usr/bin/gcc /usr/bin/cc
--
Stig Palmquist <stig@palmquist.org>
------------------------------
Date: Wed, 04 Oct 2000 13:49:54 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: problems to install perl module
Message-Id: <39DB1962.DE5C68B3@bigfoot.com>
Stig Palmquist wrote:
>
> "Bo Pan" <bpan99@yahoo.com> writes:
>
> > Hello,
> > I am trying to install XML:Parser on my SGI machine, (IRIX 6.5). As I
> > do not have cc compiler,
> > I installed gcc. But when ever I try 'perl Makefile.PL', makefile
> > generated still uses cc as
> > compiler, and CFlag includes -n32, mip3, etc.
> > What should I do to make the Makefile use gcc?
> > Thanks in advance.
>
> ln -s /usr/bin/gcc /usr/bin/cc
I am not sure that gcc understands the SGI cc flags stated above.
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: Wed, 04 Oct 2000 10:17:11 +0100
From: Bap <lists@a1.org.uk>
Subject: Re: reading a secret
Message-Id: <39DAF596.11BA5B3F@a1.org.uk>
Anders Lund wrote:
> Bap wrote:
>
> > Hello all,
> > can any one help me with this one?
> > I need to somehow flush the input buffer immediately before I ask for a
> > password,
> > so that when I read the input, I only get what is typed after the prompt
> > is output.
> >
> > This is for an install script for a database ap. which if is not
> > supplied with uname and
> > passwd, will default to the current EUID and ask for their pg password.
> > The sleep is
> > there so that I can enter chars into the buffer while I try to get this
> > to work.
> >
> > sub askForPass{
> > my( $key, $pass );
> > sleep 5;
> > ReadMode 2;
> > while( defined( $key = ReadKey( -1 ) ) ){
> > # I hoped this would clear it, but, no.
> > }
> > #my $term = Term::ReadLine->new();
> > #$term->OUT;
> > print "Enter postgres password for $USERNAME:";
> > until( ( $key = ReadKey( 0 ) ) eq "\n" ){
> > $pass .= $key;
> > }
> > #$pass = ReadLine 0;
> > #$pass = $term->readline( "Enter postgres password for $USERNAME:" );
> > ReadMode 0;
> > print "\n$pass\n";
> > }
> >
> > Thanks in advance for any help,
> > Bap.
> >
>
> ??
>
> print "hello, how are you? ";
> $answer = <STDIN>;
> chop $answer;
> print "Sorry, why don't you take the rest of the day of!\n" unless $answer;
> for ($answer) {
> print "nice\n", last if /fine/i;
> #...
> }
>
> -anders
>
> --
> [ the word wall - and the trailing dot - in my email address
> is my _fire_wall - protecting me from the criminals abusing usenet]
I have the "sleep" in there to allow me to put some chars into the input
buffer.
I don't want to echo the entered text, that is why I have used ReadMode 2
STDIN would work OK if there were no chars entered in the input during the
sleep.
If you try the sub I posted, you will see what I mean ( you could replace the
until loop
with $pass = <STDIN>; if you want, but the effect is the same.
------------------------------
Date: Wed, 04 Oct 2000 12:51:59 +0200
From: Toralf Lund <toralf@kscanners.com>
Subject: Re: Remote execution (rsh) of Perl script (hanging processes)
Message-Id: <39DB0BCF.533E4C67@kscanners.com>
> I think I've seen a note on this before somewhere in some kind of Perl
> related documentation, but I'm unable to find this now, so here we go:
>
> Quite frequently when I start a perl script via the rsh command, rsh
> will hang after the script has exited. There will be two "rsh" processes
> left, and they have to be killed the hard way, i.e. using kill -9 .a.k.a
> . kill -KILL. Any ideas how to avoid this?
>
> I'm seeing this when two (Red Hat 6.2) Linux hosts are talking to each
> other, and I'm using perl version 5.00503, but I seem to remember having
> encountered this on other setups, too.
Hmmmm. I'm starting to suspect the problems are related to (Red Hat) Linux
"rsh" after all. As it happens, I tend to issue the "rsh" call from a Perl
script, too, though. Does anyone know how to initiate remote execution
without using system("rsh ...") or similar? I know I can use the Socket
module to talk more directly to the rsh daemon, but does anyone have an
example of how this is done??
- Toralf
------------------------------
Date: Wed, 04 Oct 2000 12:48:15 +0200
From: Torsten Schindler <Torsten.Schindler@ccc.uni-erlangen.de>
Subject: Re: Result of functions in child processes
Message-Id: <39DB0AEF.3990523A@ccc.uni-erlangen.de>
Thanks for your answer, it works now.
Torsten
------------------------------
Date: Wed, 04 Oct 2000 08:31:08 GMT
From: Abel Almazan <abel@inlander.es>
Subject: Retrieve info from cookie??
Message-Id: <39DAEA50.2E9FDA34@inlander.es>
Hi,
How can i retrive some data from cookies in perl??
I have some code, but it doesn't work!!!
The code is something like that:
#!/usr/bin/perl
use strict;
use CGI;
my $cgi = new CGI;
my $smcookies = $cgi->cookie('smcookies');
$smcookies =~ /country::([^&]+)/;
my $country = $1;
$smcookies =~ /lang::([^&]+)/;
my $language = $1;
print"Content-type: text/html\n\n";
print"<html><body>
${country}
</body></html>";
exit;
I want to get the cookie named "smcookies" and then extract the
"country" and "lang" info, but i don't get anything in ${country}
Help plz
thanx
------------------------------
Date: Wed, 04 Oct 2000 09:01:43 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Retrieve info from cookie??
Message-Id: <slrn8tlssg.3h0.rgarciasuarez@rafael.kazibao.net>
Abel Almazan wrote in comp.lang.perl.misc:
>Hi,
>
>How can i retrive some data from cookies in perl??
>
>I have some code, but it doesn't work!!!
>
>The code is something like that:
>
>#!/usr/bin/perl
>use strict;
>use CGI;
>my $cgi = new CGI;
>my $smcookies = $cgi->cookie('smcookies');
>$smcookies =~ /country::([^&]+)/;
>my $country = $1;
>$smcookies =~ /lang::([^&]+)/;
>my $language = $1;
>
>print"Content-type: text/html\n\n";
>print"<html><body>
>
>${country}
>
></body></html>";
>
>exit;
>
>I want to get the cookie named "smcookies" and then extract the
>"country" and "lang" info, but i don't get anything in ${country}
You haven't told us what is supposed to be in smcookies. Perhaps
something like 'country::foo&lang::bar' ? Your code looks correct.
Try to print $smcookies in your generated HTML page, this will output
the raw cookie value (or nothing if the cookie is not transmitted -- in
this case the problem probably comes from the code that sets the cookie).
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Wed, 04 Oct 2000 09:59:28 GMT
From: Abel Almazan <abel@inlander.es>
Subject: Retrive info from a cookie???
Message-Id: <39DAFF04.7EF66F25@inlander.es>
Hi,
How can i retrive some data from cookies in perl??
I have some code, but it doesn't work!!!
The cookie has the next info:
.starmedia.com TRUE / FALSE 1014445877 smcookies
lang%3A%3Aspa%26country%3A%3Aes%26tz_offset%3A%3A1%26tz_id%3A%3A24%26timestamp970645859
The code is something like that:
#!/usr/bin/perl
use strict;
use CGI;
my $cgi = new CGI;
my $smcookies = $cgi->cookie('smcookies');
$smcookies =~ /country::([^&]+)/;
my $country = $1;
$smcookies =~ /lang::([^&]+)/;
my $language = $1;
print"Content-type: text/html\n\n";
print"<html><body>
${country}
</body></html>";
exit;
I want to get the cookie named "smcookies" and then extract the
"country" and "lang" info, but i don't get anything in ${country}
Help plz
thanx
------------------------------
Date: Wed, 4 Oct 2000 13:20:47 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Retrive info from a cookie???
Message-Id: <DpEC5.331$u23.34367@news000.worldonline.dk>
Abel Almazan wrote:
> The cookie has the next info:
>
> .starmedia.com TRUE / FALSE 1014445877 smcookies
>
lang%3A%3Aspa%26country%3A%3Aes%26tz_offset%3A%3A1%26tz_id%3A%3A24%26timestamp970645859
>
lang%3A%3Aspa%26country%3A%3Aes%26tz_offset%3A%3A1%26tz_id%3A%3A24%26timestamp970645859
Theese lines are URL encoded, needs to be unencoded. CGI has undocumented
methods for that, CGI::escape($string) and CGI::unescape($string)
See below..
> The code is something like that:
>
> #!/usr/bin/perl
> use strict;
> use CGI;
> my $cgi = new CGI;
> my $smcookies = $cgi->cookie('smcookies');
# unencode URL escaped data
$smcookies = $cgi->unescape $smcookies;
# Now things (hopefully) works...
# dump theese!!
# $smcookies =~ /country::([^&]+)/;
# my $country = $1;
# $smcookies =~ /lang::([^&]+)/;
# my $language = $1;
my $cookie; # hash for cookie key/value pairs
my @cookieparams = split /\&/, $smcookie;
for (@cookieparams) {
my ($key, $value) = split /::/;
$cookie{$key} = $value;
}
>
> print"Content-type: text/html\n\n";
> print"<html><body>
>
<!-- ${country} # dump, do -->
$cookie{'country'};
>
> </body></html>";
>
> exit;
>
> I want to get the cookie named "smcookies" and then extract the
> "country" and "lang" info, but i don't get anything in ${country}
>
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Wed, 04 Oct 2000 11:41:31 +0200
From: Lothar Schuette <schuette@compoint.de>
Subject: Serial-Timeout on Solaris
Message-Id: <39DAFB4B.DE89AD3E@compoint.de>
Hello,
on a Sun E250 with 512 MB and one CPU running Solaris 8 and Perl 5.005_3
I run into the following problem:
The application communicats with an external box over a serial line.
This box uses 19200 8N1. And there is no flow control at all.
The application opens the serial device and sets the parameter as
follows:
open(EGU, "+> /dev/term/b");
=
my $TTYParameter =3D '19200 -parenb -parodd cs8 hupcl -cstopb
cread
clocal -crtscts ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr
-igncr -icrnl -ixon -ixoff -iuclc -ixany imaxbel -opost -olcuc -ocrnl
-onlcr -onocr -onlret -ofill cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten
-echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl
-echoke';
system "stty $TTYParameter < rnDEVICE > rnDEVICE";
=
The parameter to the tty command have been tested on a Linux box and
have been adapted to Solaris.
After that the communication is done with syswrite and sysread:
syswrite(EGU, $TransAction, $len);
sysread(EGU, $Buffer, $len);
The length is calculated by the transaction data send over the line / is
send by the external box first.
In the case of reading 31 or 33 bytes there is a timeout ($SIG{ALRM} =3D
=2E.. ; alarm...;).
I tried to read in small blocks of 1, 3, 4, 10 or 20 bytes but there is
always this timeout after reading 30 bytes totaly.
=
This problem doesn't occure if 29, 30 oder more than 35 Bytes are send.
Running on Linux the application works ok.
Changing the serial devices (term/a, term/b, cua/a, cua/b) or using Perl
5.005_02 doesn't solve the problem.
So anybody has an idea to make the application work?=18=13
-- =
Best regards
Lothar Sch=FCtte schuette@COMPOINT.de
----------------------------------------------------------------------
Intra- u. Internet Services von http://www.COMPOINT.de
COMPOINT network consulting gmbh phone +49 561 98223-0
Triftstra=DFe 103, D-34246 Vellmar fax +49 561 98223-302
----------------------------------------------------------------------
------------------------------
Date: Wed, 04 Oct 2000 12:00:16 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Serial-Timeout on Solaris
Message-Id: <B6009412.75D4%elaine@chaos.wustl.edu>
in article 39DAFB4B.DE89AD3E@compoint.de, Lothar Schuette at
schuette@compoint.de quoth:
> on a Sun E250 with 512 MB and one CPU running Solaris 8 and Perl 5.005_3
> I run into the following problem:
>
> The application communicats with an external box over a serial line.
> This box uses 19200 8N1. And there is no flow control at all.
>
> This problem doesn't occure if 29, 30 oder more than 35 Bytes are send.
>
> Running on Linux the application works ok.
> Changing the serial devices (term/a, term/b, cua/a, cua/b) or using Perl
> 5.005_02 doesn't solve the problem.
I've never seen this problem on a sparc but one thing you might do is
double-check all of the stty parameters. Solaris isn't even in the ballpark
of Linux so that it runs fine on it but not Solaris makes me think there is
something in the stty settings that is causing your problem. Also, you might
read http://www.easysw.com/~mike/serial/serial.html#2_5_2 which I have
always found useful in the past despite it's in C.
Another thing to look at is the patch level and make sure you have installed
all of the latest recommended patches since, if you do call Sun for support,
this is the first question usually and they won't talk to you until you are
up to date.
e.
------------------------------
Date: Wed, 04 Oct 2000 13:50:00 +0300
From: Victor Koldun <lkh@class.class.lviv.ua>
Subject: Simultaneous file access and FLOCK?
Message-Id: <39DB0B58.99C39654@class.class.lviv.ua>
Hi everyone,
I have read much on FLOCK, but am still confused. It is said to be
"merely advisory", so what's the use?
To be short: assume we have a file and a script to modify the file.
Person A calls the script to modify the file, which opens it and applies
an exclusive lock. Person B calls the very same script and tries to do
the same, while A still is working with the file.
What will happen? Will B's script instance just have to wait until the
file is freed, or will B see an error message (which is terrifying me)?
Big systems that register hundreds of users simultaneously, how do they
work around this problem?
I have built a large website, and this concern is the only thing that
bothers me and prevents me from launching the site. Please help!...
Yaros
(thanx in advance :)
------------------------------
Date: 04 Oct 2000 12:21:28 +0100
From: nobull@mail.com
Subject: Re: Simultaneous file access and FLOCK?
Message-Id: <u9snqcrgw7.fsf@wcl-l.bham.ac.uk>
Victor Koldun <lkh@class.class.lviv.ua> writes:
> I have read much on FLOCK, but am still confused. It is said to be
> "merely advisory", so what's the use?
Exactly the same use as traffic lights rather than physical barriers
at intersections. So long as everyone obeys the convention that you
stop at a red light you don't get a collision.
> To be short: assume we have a file and a script to modify the file.
> Person A calls the script to modify the file, which opens it and applies
> an exclusive lock. Person B calls the very same script and tries to do
> the same, while A still is working with the file.
>
> What will happen? Will B's script instance just have to wait until the
> file is freed, or will B see an error message (which is terrifying me)?
Dunno, I've not seen the script. Unless it makes a non-blocking lock
request then the request will block. If it makes a non-blocking lock
request then what it does on failure is up to the programmer.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 04 Oct 2000 14:56:49 +0300
From: Victor Koldun <lkh@class.class.lviv.ua>
Subject: Re: Simultaneous file access and FLOCK?
Message-Id: <39DB1B00.DB3B8EDE@class.class.lviv.ua>
Hunting for info across the Net, here's what I found:
Using flock() causes these multiple submissions to be
processed in queue, preserving the integrity of the open file.
This could be the answer to my question, but *then* the FLOCK function should
never cause errors... it should patiently wait for the file to be unlocked.
In real life, the programmer should check it:
FLOCK(FH, 2) or die("swear");
as soon as I can judge from what I've seen in others' scripts... Confusion
again...
Maybe I should use the sleep function in a loop to try to unlock the file a
couple of times?
until(FLOCK(FH,2)) { sleep 10; }
Sorry for being annoying, :)
Yaros
> Victor Koldun <lkh@class.class.lviv.ua> writes:
>
> > I have read much on FLOCK, but am still confused. It is said to be
> > "merely advisory", so what's the use?
>
> Exactly the same use as traffic lights rather than physical barriers
> at intersections. So long as everyone obeys the convention that you
> stop at a red light you don't get a collision.
> > To be short: assume we have a file and a script to modify the file.
> > Person A calls the script to modify the file, which opens it and applies
> > an exclusive lock. Person B calls the very same script and tries to do
> > the same, while A still is working with the file.
> >
> > What will happen? Will B's script instance just have to wait until the
> > file is freed, or will B see an error message (which is terrifying me)?
>
> Dunno, I've not seen the script. Unless it makes a non-blocking lock
> request then the request will block. If it makes a non-blocking lock
> request then what it does on failure is up to the programmer.
>
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: Wed, 4 Oct 2000 08:17:38 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: some questions
Message-Id: <Pine.GSO.4.21.0010040816490.14163-100000@crusoe.crusoe.net>
On Oct 3, Larry Rosler said:
>In article <BAuC5.2538$Tx3.241940@news.uswest.net>,
>jerome@activeindexing.com says...
>> <zoo.tv@btinternet.com> elucidates:
>> >
>> > <jonrasm@my-deja.com> wrote in message news:8rdis9$g1f$1@nnrp1.deja.com...
>> >> I am trying to remove some characters from
>> >> strings by using:
>> >>
>> >> foreach $line (@line)
>> >> {
>> >> $line =~ tr/\"/ /;
>> >> }
>> >
>> > Use s/// for this.
>>
>> Why? It's much, much slower.
>>
>> Larry will be along any minute and explain why.
>
>No, I won't explain why. The Benchmark module can demonstrate that is
>is a fact, though.
>
>But Ilya may be along any minute to explain why the dramatically slower
>performance of s/// is an implementation bug.
Wouldn't it be nice if cases of
s/[CHARS]//g
and
s/[CHARS]+//g
were optimized to tr/CHARS// (if [CHARS] is constant)...?
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Wed, 04 Oct 2000 12:41:37 +0200
From: Toralf Lund <toralf@kscanners.com>
Subject: Re: The match operator & variables containing regexp-characters
Message-Id: <39DB0961.AC7EA701@kscanners.com>
> > My perl scripts sometimes exit with a syntax error in constructs of the
> > form
> >
> > if($line~=m/$variable/) {
> > print($line, " matches\n");
> > }
>
> I'm sure it fails because there is no such operator as ~=.
I never get this right the first time... But is was correct in the original
code, of course.
>
>
> > Because the variable contains regexp special characters like '+' and
>
> ...
>
> > The question is simply: Is there a way a can force the contents of the
> > variable to be taken literally, why otherwise retaining the regexp
"why otherwise"? I definitely hurried too much when writing this. I should be
"while", of course. A bad case of spell checker replacements there, I guess.
> > functionality (i.e. I want to be able to prepend or append normal sub
> > expressions to the (literal) variable expansion)?
>
> if ($line =~ /\Q$variable/) {
> ...
> }
This is exactly what I was looking for. I found a description right away in
the manual pages now, of course, but I overlooked it earlier. I guess I could
still get into trouble if the variable contains '\E', though, but it probably
won't.
Thanks.
- Toralf
------------------------------
Date: Wed, 4 Oct 2000 11:53:45 +0100
From: "Tigz" <tigz@ntlworld.com>
Subject: what on is correct???
Message-Id: <j%DC5.12453$L12.251687@news2-win.server.ntlworld.com>
Hi could someone tell me which is correct, both seem to work fine, but i am
not sure. I actually dont have a clue what i am doing... I am just trying to
lern....
if ($testver eq 0) {
print ("test 1"\n");
} else {
print ("test"\n");
}
or this:
if ($testver eq 0) {
print ("test 1"\n");
}
if ($tierlevel gt 0) {
print ("test"\n");
}
thankx
mick.
------------------------------
Date: 04 Oct 2000 12:16:51 +0100
From: nobull@mail.com
Subject: Re: what on is correct???
Message-Id: <u9u2asrh3w.fsf@wcl-l.bham.ac.uk>
"Tigz" <tigz@ntlworld.com> writes:
> Hi could someone tell me which is correct, both seem to work fine, but i am
> not sure. I actually dont have a clue what i am doing...
Nor do we. How can we tell you if what you are doing is right if you
don't give us a clue what you are trying to achieve.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 4 Oct 2000 13:36:15 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: what on is correct???
Message-Id: <ODEC5.929$UW.30440@news010.worldonline.dk>
Tigz wrote:
> Hi could someone tell me which is correct, both seem to work fine, but i
> am not sure. I actually dont have a clue what i am doing... I am just
> trying to lern....
>
Read the perl manuals, learn how to use perldoc!!
Buy a book (if in doubt, try "Learning Perl" or "Programming Perl", both
from O'Reilly)
> if ($testver eq 0) {
Above is string comparison. To get numerical comparison use "=="
as "if ($test == 117)"
To learn, try
$perldoc perlop
> print ("test 1"\n");
you mean
print "test 1\n";
Parens are *not* widely used for print statements in perl, though they
don't harm. The quotes must match.
> if ($tierlevel gt 0) {
operators again (unless "gt" is screwed HTML, but you NEVER post HTML to
usenet, do you???)
die "ARRRRGH, this world is SCREWED UP\n" if (1>2);
> thankx
Your'e wellcome..
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Wed, 4 Oct 2000 12:53:34 +0100
From: "Tigz" <tigz@ntlworld.com>
Subject: Re: what on is correct???
Message-Id: <pTEC5.12531$L12.252689@news2-win.server.ntlworld.com>
Why O' why does every body take little fits, when somebody supposidly abuses
the usenet?
I beats me i am telling u!
Anders Lund <anders@wall.alweb.dk> wrote in message
news:ODEC5.929$UW.30440@news010.worldonline.dk...
> Tigz wrote:
>
> > Hi could someone tell me which is correct, both seem to work fine, but i
> > am not sure. I actually dont have a clue what i am doing... I am just
> > trying to lern....
> >
>
> Read the perl manuals, learn how to use perldoc!!
> Buy a book (if in doubt, try "Learning Perl" or "Programming Perl", both
> from O'Reilly)
>
> > if ($testver eq 0)
> Above is string comparison. To get numerical comparison use "=="
> as "if ($test == 117)"
> To learn, try
> $perldoc perlop
>
> > print ("test 1"\n");
>
> you mean
> print "test 1\n";
>
> Parens are *not* widely used for print statements in perl, though they
> don't harm. The quotes must match.
>
> > if ($tierlevel gt 0) {
> operators again (unless "gt" is screwed HTML, but you NEVER post HTML to
> usenet, do you???)
>
> die "ARRRRGH, this world is SCREWED UP\n" if (1>2);
>
> > thankx
>
> Your'e wellcome..
>
> -anders
> --
> [ the word wall - and the trailing dot - in my email address
> is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Wed, 4 Oct 2000 13:58:07 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: what on is correct???
Message-Id: <iYEC5.933$UW.30645@news010.worldonline.dk>
Tigz wrote:
> Why O' why does every body take little fits, when somebody supposidly
> abuses the usenet?
> I beats me i am telling u!
usenet is a high value for many of us, but if people do not try to respect
etiquette, the value decreases, time is wasetd etc.
Sorry that I forgot a ;-)) at the end of that one...
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
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 4516
**************************************