Yes, you can call subroutines either way, with or without the .
The only case when the subroutine must be prefixed with an
ampersand is, I believe, when you're assigning a reference
variable, eg:
$reference_x = \subroutine_y;
But that's another story.
Kevin
-- Original Message
Kevin Christopher wrote at Wed, 05 Jun 2002 04:58:38 +0200:
Yes, you can call subroutines either way, with or without the . The only case
when the
subroutine must be prefixed with an ampersand is, I believe, when you're assigning a
reference
variable, eg:
$reference_x = \subroutine_y;
Octavian Rasnita wrote at Tue, 04 Jun 2002 08:03:21 +0200:
Hi all,
I know why I should use use strict; but what happen if I use use strict; then
if the code is
OK, I delete this line?
use strict has (e.g.) the benefit for checking for undef values.
They can come from the input.
(User
Hmm, somehow your script seems not to work,... :-(
I just get this Kind of Output after parsing the sample file below,...
First Test System: Test System 1 (MyTest: Main area to get crap
Second Test System: Test System 2 (misc: Other information to confuse code)
Third Test System: Test System
-Original Message-
From: Jason Ostrom [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 10:06 PM
To: [EMAIL PROTECTED]
Subject: Dynamically creating submit buttons
To those in the know, I have a couple of questions about the best way
to create dynamic form elements.
I
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 6:19 AM
To: [EMAIL PROTECTED]
Subject: Re: Why using use strict;
Octavian Rasnita wrote at Tue, 04 Jun 2002 08:03:21 +0200:
Hi all,
I know why I should use use strict;
-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 2:03 AM
To: [EMAIL PROTECTED]
Subject: Why using use strict;
Hi all,
I know why I should use use strict; but what happen if I use use
strict; then if the code is OK, I delete
-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: subroutine or subroutine
Hi all,
I've seen some subroutines are ran without the sign in front of the
subroutine name, like:
On Wednesday, June 5, 2002, at 05:51 , Bob Showalter wrote:
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 6:19 AM
Octavian Rasnita wrote at Tue, 04 Jun 2002 08:03:21 +0200:
I know why I should use use strict; but what happen
I'd suggest using prototypes if you are going to be passing more than
3 variable references, or 3 or more different types of varible references.
This is for your own sanity.
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 9:30 AM
To:
So, in post after post after post I see the comment always use strict...
I have seen threads where people are insulted because they dont...
Every perl tutorial I've seen says you should always use strict...
It apparently doesnt slow down code execution...
If you dont use strict, the perl
On Tuesday 04 June 2002 6:02 pm, fliptop wrote:
drieux wrote:
one of the problems I keep bumping my head into
is that fundamentally perl is a Kult - and as such
tends to not always be a well organized kult - since
they are never clear as to which are the true cannons of the faith
and
because it would reek havoc on all the perl one liners.
And deter many beginners that are touching perl for the first time.
And would annoy those who have to write a quick 5 line script in 3 seconds
that forget a my for $line.
-Original Message-
From: Jake [mailto:[EMAIL PROTECTED]]
IMHO only the first of these may be a valid reason. But I dont know much
about perl one liners.
Your second reason is particularly bad, beginners are the ones who need use
strict the most!
On Wednesday 05 June 2002 10:12 am, Nikola Janceski wrote:
because it would reek havoc on all the perl
-Original Message-
From: Jake [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 8:56 AM
To: [EMAIL PROTECTED]
Subject: Why do we even HAVE to... (was: Why using use strict;)
So, in post after post after post I see the comment always
use strict...
It's a good
I was referring to those just touching the water, not the ones already waist
deep.
yes after you have your feet wet you should be using use strict at all
times,
and don't forget use warnings to help with those foolish mistakes we all
make.
If only I knew that back in Perl 4, when I was getting
On Wednesday, June 5, 2002, at 08:31 , Theuerkorn Johannes wrote:
Ok, found one easy solution: as I need to parse the whole file anyway, i
am removing all newline by doing:
if (open(LOG,$fileName)) {
open (temp1,$temp);
while (LOG)
{
chomp;
my
Im a bit worried that a few of my statements have been misconstrued, and I was
concerned that would happen when I first posted. Let me try to clarify - and
I should also preface this with I am primarily a C/C++ programmer (I'm
addicted to the Qt toolkit) who really uses perl only when he
This one is a little hard to explain. I have a .cgi program that offers a
textarea form box. The contents are used to generate a text file that is
then used as an SSI in an html program. This text must be changed from
time to time.
In order to make it easier to modify the text, I grab the
The problem lies within the one liner code.
But also some just don't understand it, and don't use perl often enough to
care about it.
This issue was brought up in the Apocalypse for Perl 6:
http://dev.perl.org/perl6/apocalypse/1 (scroll to RFC 16)
RFC 16: Keep default Perl free of constraints
hi
i want to connect mysql with perl , first i try
---
#!c:\perl\bin\perl.exe
print Content-type: text/html\n\n;
use Msql;
so i change to
#!c:\perl\bin\perl.exe
print Content-type:
because Perl has evolved over time?
joel
-Original Message-
From: Jake [mailto:[EMAIL PROTECTED]]
Sent: 05 June 2002 13:56
To: [EMAIL PROTECTED]
Subject: Why do we even HAVE to... (was: Why using use strict;)
So, in post after post after post I see the comment always use strict...
I
--- Jake [EMAIL PROTECTED] wrote:
Im a bit worried that a few of my statements have been misconstrued, and I was
concerned that would happen when I first posted.
Jake,
No worries, I didn't misconstrue your comments. I deliberately changed the subject in
hopes that
no one would think I was
On Wednesday, June 5, 2002, at 08:40 , Ovid wrote:
[..]
First-rate mathematicians want to hang around first-rate
mathematicians. Second-rate mathematicians want to hang
around third-rate mathematicians.
The reason for that is left as an exercise for the reader :)
Cheers,
I am writing my first CGI application and after analysis of the data
structure that is required I determined that a DBM file would not be
sufficient. Mysql was suggested to me. Unfortunately I could not find
A book that seemed based on Perl and sql. Everything I found connected
Mysql to PHP
Johannes,
That is the output that the program is supposed to output. I am terribly
sorry that my comments are not clear (Good thing I am not a teacher).
It may be easier to understand if you analyze what calls produce the
variable values that are displayed.
Example: the value 'Test
Try O'Reilly's MySql mSQL. Also use the Online reference at www.mysql.org
(documentation, MySQL APIs)
Kristofer
Original Message Follows
From: Maureen E Fischer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Perl/CGI mysql book
Date: Wed, 5 Jun 2002 11:12:13 -0700
I am writing
Hi,
What kind of trouble are you having with your first connect? Are you
having a MySQL issue or is it with the Perl DBI?
I am one of the authors of Writing CGI Applications with Perl and I would
love to help you out and also see what other details may need to be added
to any future versions
Um.. what did the book not cover about this? We used DBI to connect to
MySQL in about every chapter. What did the simple example on page 57
not provide for connecting to a DB?
Cheers,
Kevin
On Wed, Jun 05, 2002 at 11:12:13AM -0700, Maureen E Fischer ([EMAIL PROTECTED]) said
something similar
Programming the Perl DBI
http://www.oreilly.com/catalog/perldbi/
SAMS Teach Yourself SQL in 10 Minutes
(It's a lie but it's still a helpful book)
http://www.amazon.com/exec/obidos/ASIN/0672321289/qid=1023301413/sr=1-1/ref=
sr_1_1/002-4842183-8613640
-Original Message-
From: Maureen
hi guys,
i got the cgi::session module, but it is a front end to Apache::Session
which is not available for win32, how come the cgi::session is available
but
the apache::session is not??!!, so weared, but this is not the problem, the
problem is how to create session in win32 without that
There are many possible sources of error. Please include the actual error
you received, and you will get the help you need.
I have posted a few DBI/CGI scripts here
http://www.geocities.com/k2001evad/pindex.html
They are abit crude, but if you have MySql up and running on you machine and
the CGI,
Does anyone know how to capture the carriage return to prevent a user from
accidentally submitting the form by pressing 'return' before they actually finish
completing the form?
-Rob
-
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup
Bob,
Your comments did help. My response below:
Bob Showalter This is a drill down concept, right? Why not just use a simple link?
Bob Showalter A HREF=...Details/A
I don't think this is just a drill down concept. I need some way of
passing the variables between the pages so that a
-Original Message-
From: Rob Roudebush [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 3:29 PM
To: cgi cgi-list
Subject: Capturing carriage return signal to cgi form
Does anyone know how to capture the carriage return to
prevent a user from accidentally submitting
If your as lazy as I am and hate to type you wouldn't have this debate...I can't
remember ever
writing a script that I started from scratch for years now. I almost always start with
an existing
script cause 9 times out of 10 it has something in it I'll need anyway...and I am
the cut
Hello,
I am somewhat of a newbie to Perl and CGI. I have written several scripts for use on a
corporate website with great success. However, I am interested in designing an entire
website with Perl CGI, but I do not really know where to begin or any inspiration for
it.
Does anyone know where
Jason --
I don't have answers for your other questions, but ...
...and then Jason Ostrom said...
%
...
%
% I always start off my code by using CGI.pm object-oriented method:
% print $q-header( text/html ),
% $q-start_html( -title = eDPS1 DS0 Monitor, -bgcolor = #ff ),
...
%
The best place to start is with the books Learning Perl and CGI
Programming with Perl (you can find them on www.oreilly.com).
Check out this site, www.pm.org to find a Perl Mongers user group near you.
You can see what other people have done (so you can do it better) at sites
like
I don't think that use strict is necessary in a finished script. I think
anything that takes up machine cycles and isn't needed in the finished script
should remain mobile and this is probably the main reason they keep it
mobileyou might say but how many macine cycles could it possibly
Yes thank you, those were/are the books I am working through at work. I guess, to be
more specific, I am not looking to the syntax of it, but more of some design
techniques and site authoring guidelines for Perl/CGI websites.
Scot Robnett [EMAIL PROTECTED] 06/05/02 02:49pm
The best place to
My personal opinion is that cutom databases are very easy to create in a
perl script and usually run faster and more efficient than cumbersome
packages. there are many perl freebies out there to start you in the right
direction and will also serve as a better learning tool. basically a
database
Oreilly Programming the Perl DBI is a good one
also Managing and Using MySQL also an Oreilly book...
Maureen E Fischer wrote:
I am writing my first CGI application and after analysis of the data
structure that is required I determined that a DBM file would not be
sufficient. Mysql was
On Wednesday, June 5, 2002, at 08:40 , Ovid wrote:
[..]
First-rate mathematicians want to hang around
first-rate
mathematicians. Second-rate mathematicians want
to hang
around third-rate mathematicians.
The reason for that is left as an exercise for the
reader :)
So,
Another way to skip the DOS command prompt is to interprete your Perl
script using
wperl.exe instead of perl.exe.
- Gilbert LE HUU HOA -
Focal Systems
Paris
Sumit_Babu@i2
split on the ; and you now have array with all the elements of your
environment.
Wags ;)
-Original Message-
From: James Kelty [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 14:58
To: [EMAIL PROTECTED]
Subject: Parsing a path environment...
Hello.
I am writing a quick
Greetings...
I find the easiest way to talk to mySQL (and get a response!) is via
DBI... I'm guessing it's perdoc DBI, but I may be wrong... :)
If you need any help, I do this sort of dirty work on a daily basis...
---
Jason H. Frisvold
Senior ATM Engineer
Engineering
Is there any function to tell if a number is even or odd?
I am looking for an easy way to loop through a list and
output table cell bgcolor based on even / odd.
if its an even numbered row make it red if its odd make
it blue.
I have done it in the past by turning a switch on or off
but I think
Is there any function to tell if a number is even or odd?
I am looking for an easy way to loop through a list and
output table cell bgcolor based on even / odd.
if its an even numbered row make it red if its odd make
it blue.
I have done it in the past by turning a switch on or off
but
Hi,
I'd like to push all sequences of capitalized words
onto an array.
So, given this paragraph (which I just snagged off AP)
Indian Prime Minister Atal Bihari Vajpayee said
Wednesday that India would consider jointly monitoring
the disputed Kashmir border with its longtime rival
Pakistan.
Zachary Buckholz wrote:
Is there any function to tell if a number is even or odd?
I am looking for an easy way to loop through a list and
output table cell bgcolor based on even / odd.
if its an even numbered row make it red if its odd make
it blue.
$_ % 2 ? print blue\n : print red\n
Sorry, but should have been split on : as stated by drieux.
Wags ;)
-Original Message-
From: Wagner, David --- Senior Programmer Analyst --- WGO
Sent: Tuesday, June 04, 2002 15:13
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Parsing a path environment...
patrick hall wrote:
Hi,
I'd like to push all sequences of capitalized words
onto an array.
So, given this paragraph (which I just snagged off AP)
Indian Prime Minister Atal Bihari Vajpayee said
Wednesday that India would consider jointly monitoring
the disputed Kashmir border with its
Patrick Hall wrote at Wed, 05 Jun 2002 11:01:31 +0200:
Hi,
I'd like to push all sequences of capitalized words onto an array.
So, given this paragraph (which I just snagged off AP)
Indian Prime Minister Atal Bihari Vajpayee said
Wednesday that India would consider jointly monitoring the
Patrick Hall wrote:
Hi,
Hello,
I'd like to push all sequences of capitalized words
onto an array.
So, given this paragraph (which I just snagged off AP)
Indian Prime Minister Atal Bihari Vajpayee said
Wednesday that India would consider jointly monitoring
the disputed Kashmir
Hi
I have been looking back at this problem and here is what I have found.
Lets take the following set of times
A , B
1 (4 , 5)
2 (9 , 10)
3 (11 , 12)
4 (12 , 14)
5 (12 , 18)
6 (14 , 15)
If we sort by column A the set inherits the following
SNIP
%
% or which ever your KULT fave login world is, and then sort
% out which path thingies belong where - ala
%
% if( $ARCH == sgi ) then
Ahhh! If/elseif trees! Ick!
SNIP
See, a great place for a SWITCH statement (*snicker*)
/me runs away
If you have not already got the solution try this. I am sure the gurus out
there can clean up the code to make it short.
# --- testing the fuction --
# --- $i simulating the row number or cell number as you wish --
for ($i=0; $i10; $i++){
print get_cell_color($i);
}
# --- function to set
I'm having a problem getting my output to print to the LOGFILE as a FAILED
UPDATE
Everything reports that Updated waybill number... ok even though I put
data that should fail in my input file.
What am I doing wrong?
$sql_upd =3D update bcerts_2001 set track_num=3D\'$track_num\' ;
So, I'm trying to use this script (which was mentioned in an earlier
submission to the list, I believe):
http://www.roth.net/perl/scripts/scripts.asp?DirMon.pl
I tried to do the following command: perl DirMon.pl -?
And I get this error back:
Can't locate Win32/Daemon.pm in @INC (@INC contains:
The answer is in your question...
http://www.roth.net/perl
The Win32::Daemon module is available from Dave Roth's site.
HTH
John
-Original Message-
From: Ron Powell [mailto:[EMAIL PROTECTED]]
Sent: 05 June 2002 14:03
To: perl beginners
Subject: Newbie Module Install question...
/looks sheepish
I should have started there first. I made the (wrong and relatively stupid)
assumption that the module would be at cpan...
I'll quit wasting bandwidth now. Perhaps a career in Truck Driving would
better suit me at this point :)
Thanks for the pointer, though.
Ron
-Original Message-
From: Adam Vardy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 10:26 PM
To: [EMAIL PROTECTED]
Subject: From tutorial
Can someone help please. I'm learning from scratch. What is this?
$_='My email address is [EMAIL PROTECTED].';
/(.*)/i;
-Original Message-
From: Zachary Buckholz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 10:11 PM
To: [EMAIL PROTECTED]
Subject: probably a simple question
Is there any function to tell if a number is even or odd?
I am looking for an easy way to loop through a list and
Hello Listers,
I am struggling to get this right. Beginner in perl, so please forgive
ignorance, but the regular expressions are confusing.
I am trying to read in a file, with content as follows
---snip---
1984 by George Orwell
A BEND IN THE RIVER by V.S. Naipaul
A CLOCKWORK ORANGE by Anthony
Here is my solution, others will differ...
# always print $! on error so you can see the cause
open( INFILE,books.txt ) || die Cann't Open: $!;
while( INFILE ) {
chomp; # remove the newline
next unless ($_); # skip blank lines
# split the line by the seperator
Hello,
I haven't tried it yet and wanted to know if anyone has the clue before I delve deeper
into it (just being lazy :)). According to the documentation , the Archive::Tar module
supports the *.gz format. I didn't find anything about *.Z (the compress format on
UNIX). Does Archive::Tar
Robert Hanson wrote at Wed, 05 Jun 2002 15:57:05 +0200:
Here is my solution, others will differ...
Yep, if you like it short ;-)
open BOOK_LIST, books.txt or die Can't Open: $!;
print join \n, map {chomp; /(.*) by (.*)/; $2 - $1} (BOOKLIST);
close BOOK_LIST;
# always print $! on error so
Janek Schleicher wrote at Wed, 05 Jun 2002 16:19:11 +0200:
Yep, if you like it short ;-)
open BOOK_LIST, books.txt or die Can't Open: $!;
print join \n, map {chomp; /(.*) by (.*)/; $2 - $1} (BOOKLIST);
^^^
Oh a typo :-(
close
Hello David,
Wednesday, June 5, 2002, 12:30:46 AM, you wrote:
Adam --
%
% /(.*)/i;
This (the // part) searches $_ ('cuz it's that with which we expect we're
working) for a and then zero or more of anything and then a and it
Searches, does not sound like much of a concept. You see,
On Tuesday, June 4, 2002, at 07:36 , David T-G wrote:
...and then drieux said...
% % On Tuesday, June 4, 2002, at 04:58 , David T-G wrote:
%
[..]
% much as a peek forward to where and how he can start thinking
% about doing things better
I suppose I should do a better job of thinking
Thanks Janek and Japhy and Drieux for all the help on this!
I've yet to look at this Tie::Pick, but will.
In the meantime, I've gone with the Japhy solution,
$element = @things[rand @things];
because it was the simplest (and works).
I didn't quite see why you would have to do a +1 on
Hello Bob,
Wednesday, June 5, 2002, 10:37:59 AM, you wrote:
If this is from a tutorial, you need to find another tutorial :)
Sure. Suggestions?
--
Adam V.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Adam, et al --
...and then Adam Vardy said...
%
% Hello David,
Hi!
%
% Wednesday, June 5, 2002, 12:30:46 AM, you wrote:
%
% %
% % /(.*)/i;
%
% This (the // part) searches $_ ('cuz it's that with which we expect we're
% working) for a and then zero or more of anything and then a and
Adam, et al --
...and then Adam Vardy said...
%
% Wednesday, June 5, 2002, 10:37:59 AM, you wrote:
%
% If this is from a tutorial, you need to find another tutorial :)
%
% Sure. Suggestions?
I'd love to see sites that make it onto other people's highly
recommended list, but I'm sure that
On Wednesday, June 5, 2002, at 05:18 , Ron Powell wrote:
SNIP
%
% or which ever your KULT fave login world is, and then sort
% out which path thingies belong where - ala
%
%if( $ARCH == sgi ) then
Ahhh! If/elseif trees! Ick!
SNIP
See, a great place for a SWITCH statement
I didn't quite see why you would have to do a +1 on the following:
my $RandomScript = $Scripts[int(rand($#Scripts + 1))];
The '$#array' construct returns the index of the last element of the
'@array'. 'rand $number' returns a random number between 0 (inclusive)
and $number (exclusive).
On Wednesday, June 5, 2002, at 06:10 , Ron Powell wrote:
[..]
I should have started there first. I made the (wrong and relatively
stupid)
assumption that the module would be at cpan...
rule of thumb is 'why not check there first' - since they do
have a reasonable collection of the basic
shouldn't it be written as this to aviod that confusion:
my $RandomScript = $Scripts[rand(@Scripts)];
-Original Message-
From: Felix Geerinckx [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: Re: Thanks - Re: Regex problem
On Wednesday, June 5, 2002, at 07:34 , [EMAIL PROTECTED] wrote:
[..]
I apparently do not have that. Is CPAN the place for that? Is it safe\n
from viruses and such? Is there install instructions?\n
assuming that you are as concerned about 'viri' - you might want
to ship your email as
This subroutine is supposed to chech the validity of an IP address. 4 numbers (1 -
255) separated by .. But my regular expression doesn't seem to be working out for
me.
print Enter IP address: ;
chomp($ip = STDIN);
ipcheck($ip);
sub ipcheck{
if ($_[0] =~
On Jun 5, Michael Norris said:
This subroutine is supposed to chech the validity of an IP address. 4
numbers (1 - 255) separated by .. But my regular expression doesn't
seem to be working out for me.
if ($_[0] =~ m/([1-2][0..5]*[0..5]*)\.\1\.\1\.\\s*$/) {
[0..5] means [05.] -- that is, any
Michael --
...and then Michael Norris said...
%
% This subroutine is supposed to chech the validity of an IP address. 4 numbers (1 -
255) separated by .. But my regular expression doesn't seem to be working out for
me.
%
...
% if ($_[0] =~ m/([1-2][0..5]*[0..5]*)\.\1\.\1\.\\s*$/) {
I
I have a program which I want to have a bi-directional pipe to (i.e both
write and read). I am unable to tee it to a file and then read the file,
so reluctantly started to investigate the IPC modules. I have a snippet of
code here, which again works (sort of), just not in the way that I
need...
Hello:
Just downloaded my first CPAN module (woo-hoo). What risks are
associated with installing these modules? Are they checked for viruses,
etc. before posting?
- Pat
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Patrick == Patrick Griffin [EMAIL PROTECTED] writes:
Patrick Hello: Just downloaded my first CPAN module (woo-hoo).
Patrick What risks are associated with installing these modules?
In theory, many.
Patrick Are they checked for viruses, etc. before posting?
Nope. If you're using
At 05:14 PM 6/5/02 +0100, Alan John Drew wrote:
I have a program which I want to have a bi-directional pipe to (i.e both
write and read). I am unable to tee it to a file and then read the file,
so reluctantly started to investigate the IPC modules. I have a snippet of
code here, which again
When I download something (depending on how large it is/how much I trust)
I get the source code, scan it for anything dodgy (including the
makefile/make make script) and if all seems ok,
compile and install. If you can avoid it, never compile/install as root. I
generally compile the modules as an
Hi guys,
I have the following line:
system(cat $FILENAME | mailx -s \test\ $mailAddress
);
How can I check whether mailx operation above was
successful or not?
Thank you!
__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
Leon --
...and then lz said...
%
% Hi guys,
Hello!
%
% I have the following line:
% system(cat $FILENAME | mailx -s \test\ $mailAddress
% );
%
% How can I check whether mailx operation above was
% successful or not?
Just check the exit code. A quick
perldoc -f system
tells us that
the docs explain the return codes for system, this is what i used:
my $err = $? 8;
if ($err) { print puked\n }
else {print success\n}
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 12:54 PM
To: [EMAIL PROTECTED]
Subject:
Denham Eva wrote:
Hello Listers,
Hello,
I am struggling to get this right. Beginner in perl, so please forgive
ignorance, but the regular expressions are confusing.
I am trying to read in a file, with content as follows
---snip---
1984 by George Orwell
A BEND IN THE RIVER by V.S.
Hrm... according to the DBI docs, execute() returns undef if it fails...
perhaps you should be using if (defined($result)) { } ?? You might
also check for $DBI::errstr ... I believe that only exists when there
is an error...
Are you sure your update is failing?
---
David,
Thank you for useful info!
But as I can see this approach won't catch the problem
if the incorrect email was specified ?
Thank you!
--- David T-G [EMAIL PROTECTED]
wrote:
Leon --
...and then lz said...
%
% Hi guys,
Hello!
%
% I have the following line:
% system(cat
Hello all. I have trying to push a value onto the end of a two-dimension
array. Here is my code.
if( /\s+--\s+COLS\.\s+(\d+)\s+-\s+(\d+)\s+--/ ) {
push( @{questionpos[$questionno]}, $1 );
push
$_ % 2 ? print blue\n : print red\n foreach (@your_list);
This actually works?! Very strange notation, how does the compiler see
this line? I assume the mod operator evaluates to 1-true or 0-false, what
does the ? do? What does the : do? How do you have a foreach at the
end of a line
$a ? $b : $c;
is the same as
if( $a ){
$b
} else {
$c
}
see perldoc perlop (I think)
but I would have put the foreach in front for readability:
foreach (@your_list) { $_ % 2 ? print blue\n : print red\n }
-Original Message-
From: Bryan R Harris [mailto:[EMAIL
On Wednesday, June 5, 2002, at 09:49 , Alan John Drew wrote:
[..]
If you can avoid it, never compile/install as root. I
generally compile the modules as an unprivalidged user, and copy them to
~/lib/perl5/ and add the following to by script:
use lib ./lib/perl5/;
before any other use
With the solutions presented, I used rindex since what about the
title: 'Perl by example by New Author' . Doing a split and you will not have
what you expected. Here is a shot:
while ( DATA ) {
chomp;
next if ( /^\s*$/ );
my $MyPtr = rindex($_, by );
if ( $MyPtr 0
Each number in @your_list becomes $_ one at a time. It does the
modulo if true does the first operation after ? or if false then after the
:. Short and sweet, and you will get there.
Wags ;)
-Original Message-
From: Bryan R Harris [mailto:[EMAIL PROTECTED]]
Sent: Wednesday,
1 - 100 of 138 matches
Mail list logo