Re: Question on the "Camel" book

2006-09-21 Thread Mathew Snyder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dr.Ruud wrote: > "flotsan" schreef: > >> it is told the following two statements are >> different: >> >> 1) if ($_ = ) { print; } # suboptimal: doesn't test defined >> 2) if (defined($_ = )) { print; } # best >> >> But as I see it, these two do the

Re: Question on the "Camel" book

2006-09-21 Thread Dr.Ruud
"flotsan" schreef: > it is told the following two statements are > different: > > 1) if ($_ = ) { print; } # suboptimal: doesn't test defined > 2) if (defined($_ = )) { print; } # best > > But as I see it, these two do the same thing perl -le ' print defined($_) ? "\"$_\"" : "" ,

Re: Question on the "Camel" book

2006-09-21 Thread Mathew Snyder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John W. Krahn wrote: > Yes, Perl has five "false" values: undef, (), 0, '' and '0', and two of those > are valid input from the readline operator. > > > > John Should running the above from the command line make a difference? I ran them both enter

Re: Question on the "Camel" book

2006-09-21 Thread John W. Krahn
flotsan wrote: > Hey guys, Hello, > I am reading the Perl Camel book - Programming Perl 3rd Ed and having a bit > of trouble to understand some of the ideas presented in section 2.11.2. > Specifically it is told the following two statements are different: > > 1) if ($_ = ) { print; }

RE: Question on the "Camel" book

2006-09-21 Thread Thomas Bätzler
Hi, flotsan <[EMAIL PROTECTED]> asked: > I am reading the Perl Camel book - Programming Perl 3rd Ed > and having a bit of trouble to understand some of the ideas > presented in section 2.11.2. > Specifically it is told the following two statements are different: > > 1) if ($_ = ) { print; }

Question on the "Camel" book

2006-09-21 Thread flotsan
Hey guys, I am reading the Perl Camel book - Programming Perl 3rd Ed and having a bit of trouble to understand some of the ideas presented in section 2.11.2. Specifically it is told the following two statements are different: 1) if ($_ = ) { print; }# suboptimal: doesn't test d

Re: Hello

2006-09-21 Thread Randal L. Schwartz
> "Ian" == Ian Macdonald <[EMAIL PROTECTED]> writes: Ian> Next I would ask for some advice, I wish to change the MAC address of my Ian> smoothwall, firewall every 24 hours, I can do it manually, but would Ian> prefer it to be a cron job and perl seems ideal. You may well ask why I Ian> wish t

about perltoot

2006-09-21 Thread chen li
Hi all, I read some sections in perltoot. In section Autoloaded Data Methods I see some line codes as following: package Person; use Carp; our $AUTOLOAD; # it's a package global my %fields = ( name=> undef, age => undef,

Re: Hello

2006-09-21 Thread Rob Coops
I have no idea exactly how to do it, as I have never even heard of a smoothwall firewall but I would like to caution you. The thing is that as soon as you stumble upon the unlucky coincidence of changing to the same mac address as one of your fellow internet users who happens to be on the same ro

Hello

2006-09-21 Thread Ian Macdonald
Dear All, First I would like to say hello to all in the community Next I would ask for some advice, I wish to change the MAC address of my smoothwall, firewall every 24 hours, I can do it manually, but would prefer it to be a cron job and perl seems ideal. You may well ask why I wish to do such

Re: PACK statement compile error

2006-09-21 Thread hwigoda
I think you are missing the closing `. -Original Message- >From: Tony Frasketi <[EMAIL PROTECTED]> >Sent: Sep 21, 2006 10:25 AM >To: beginners@perl.org >Subject: PACK statement compile error > >Hello list. >I'm getting the following error message when compiling the program >listed below

Re: system call issues

2006-09-21 Thread John W. Krahn
Saurabh Singhvi wrote: > Hi all, Hello, > The following code block > > foreach $protein (@pdbs) { >$rmsd[$i] = 0; >foreach $protein2 (@pdbs2) { >system("./TMalign $protein $protein2 | cgrep -i rmsd > What is cgrep? I don't have that on my system. > temp") == 0

Re: Date and Time Functions

2006-09-21 Thread Xavier Mas i Ramón
A Dijous 21 Setembre 2006 01:38, [EMAIL PROTECTED] va escriure: > Hello > > I am looking for some simple perl functions that will return the current > date and time in string format. The purpose is to create a file with part > of the name being the date and time. > > Thanks, > Andrew sytem "date"

Re: PACK statement compile error

2006-09-21 Thread Mumia W.
On 09/21/2006 10:25 AM, Tony Frasketi wrote: Hello list. I'm getting the following error message when compiling the program listed below ... Bad name after c' at /test/test1.cgi line 22. line 22 is ' s/%(..)/pack('c', hex($1))/eg;' Need help in eliminating this error! thnx tony ===

Re: PACK statement compile error

2006-09-21 Thread Tony Frasketi
Hi list I found the problem. It was at line 10 print 'x[$x]"; should have been... print "x[$x]"; Thanks tony Tony Frasketi wrote: Hello list. I'm getting the following error message when compiling the program listed below ... Bad name after c' at /test/test1.cgi line 22. line 22

Re: Non-technical question

2006-09-21 Thread Chad Perrin
On Thu, Sep 21, 2006 at 08:49:56AM -0700, Randal L. Schwartz wrote: > > "Ricardo" == Ricardo SIGNES <[EMAIL PROTECTED]> writes: > > Ricardo> Good question. Here are some common pronunciations: > > Ricardo> $_ - "it" or "the topic" > Ricardo>foreach (@line) { chomp $_; }; # for eac

Re: Non-technical question

2006-09-21 Thread Randal L. Schwartz
> "Ricardo" == Ricardo SIGNES <[EMAIL PROTECTED]> writes: Ricardo> Good question. Here are some common pronunciations: Ricardo> $_ - "it" or "the topic" Ricardo>foreach (@line) { chomp $_; }; # for each line, chomp it I've always called that "dollar underscore" in the llama class

Re: system call issues

2006-09-21 Thread Saurabh Singhvi
Hi, I am sorry about the above, it was a part of the complete code. I was using warnings but not strict. Also, the OS is gentoo and fs was reiser4/ ext3, with same results. Your method kind of works, but a lot of warnings are being thrown up. The main ones being : Use of uninitialized value in

PACK statement compile error

2006-09-21 Thread Tony Frasketi
Hello list. I'm getting the following error message when compiling the program listed below ... Bad name after c' at /test/test1.cgi line 22. line 22 is ' s/%(..)/pack('c', hex($1))/eg;' Need help in eliminating this error! thnx tony = #!/usr/local/bin/perl -w use strict; # En

Re: system call issues

2006-09-21 Thread Mumia W.
On 09/21/06 07:30, Mumia W. wrote: Try the open command I wrote, and see if that works. I hope this helps. s/open command/code/ No I didn't write the open command ;-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <

Re: system call issues

2006-09-21 Thread Mumia W.
On 09/21/2006 04:52 AM, Saurabh Singhvi wrote: Hi all, The following code block is written without strictures and warnings enabled. If you place these lines, use strict; use warnings; at the top of your program, you'll catch errors much more quickly. In particular, "use strict" will fo

Re: search POD about AUTOLOAD

2006-09-21 Thread chen li
--- Jeff Pang <[EMAIL PROTECTED]> wrote: > > >I want to read some information about AUTOLOAD in > POD. > > Hi, > > Got these pieces from Schwartz's book and hope it > helps. Hi Jeff, Thank you very much, Li __ Do You Yahoo!? Tired of spam? Ya

Re: search POD about AUTOLOAD

2006-09-21 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > > I want to read some information about AUTOLOAD in > POD. > > But I get nothing when I type "perldoc -f/-q > > AUTOLOAD". > > Any comments? > > perlsub has an "Autoloading" section: > > perldoc perlsub > > Also the "AUTOLOAD: Proxy Methods" s

system call issues

2006-09-21 Thread Saurabh Singhvi
Hi all, The following code block foreach $protein (@pdbs) { $rmsd[$i] = 0; foreach $protein2 (@pdbs2) { system("./TMalign $protein $protein2 | cgrep -i rmsd > temp") == 0 or die $?; open(TEMP,'temp') or die $?; chomp($line = );

Re: array help

2006-09-21 Thread John W. Krahn
Sayed, Irfan (Irfan) wrote: > Here is my code > > # Perl script to change the replica name > > use strict; > use warnings; > > > # my $fname = "/tmp/vob_list1"; > # open FILE,">",$fname or die $!; > # my $fname1 = "/tmp/repl_list1"; > # open FILE1,">",$fname1 or die $!; > > my $CT = '/

RE: array help

2006-09-21 Thread Lee Goddard
> if i use one array in foreach loop then can i use same array > in another part of the code. What do you think? Have you actually tried to do this? Perhaps you could submit the smallest possible piece of code illustrate your prediciment? -- http://www.bbc.co.uk/ This e-mail (and any attachm

RE: Non-technical question

2006-09-21 Thread Lee Goddard
From: Ricardo SIGNES [mailto:[EMAIL PROTECTED] Sent: 21 September 2006 01:19 To: beginners@perl.org Subject: Re: Non-technical question X-Message-Flag: Warning: This sender thinks he is better than you. X-Planet: Planet of the Apes User-Agent: Mutt/1.5.11+cvs20060126 Nice headers, Ricardo. Anywa