open(DOM, GET 'http://URL') || "unable to open website\n";
The GET here doesn't actually get the results it just dumps the
main URL not the results.
The URL is
http://http://www.whitepages.com/find_person_results.pl?fid=n&f=&ft=b&l=$name<=b&c=&s=&x=45&y=10
I get stuck here...any pointers?
Thanks
Jeff
lp is greatly
appreciated.
Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Does anyone know how to get a script to execute at a predefined time without
user interaction. I would like to monitor my sys clock and have the perl
script execute. Thanks
Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Our business hosting service does not allow cron, they recommend checking
with a third party. I write the scripts on a windows machine and upload
them to the apache Unix server to test and execute them. Do you know of any
perl modules that self execute?
-Original Message-
From: Jeff
re would like to fall to sleep skimming
through perldoc.
Jeff
-Original Message-
From: Michael R. Wolf [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 29, 2001 12:35 AM
To: [EMAIL PROTECTED]
Subject: Re: Good CS Literature
Luke <[EMAIL PROTECTED]> writes:
> I bought t
aintenance. I think this would stop execution of the script. The cron is
not allowed by our business host account and autosys costs money. I am
still investigating the AT command. Thanks again!!
Jeff
-Original Message-
From: Chris Spurgeon [mailto:[EMAIL PROTECTED]]
Sent: Friday, D
read back into perl script.
Would like to hear from anybody that has done this or can direct me to a
solution.
Best Regards,
Jeff Zanzinger
RealEstateCE.com
ph: 888.895.8839
fax: 866.517.1406
<http://RealEstateCE.com/> http://RealEstateCE.com/
<>
nance nightmare in
configuration control. I'm looking for a solution where I don't have to
run and maintain 2 copies of the same scripts to support 2 separate and
independent domains.
Any help is greatly appreciated.
Best Regards,
Jeff Zanzinger
RealEstateCE.com
ph: 888.895.8839
fax
/envelope/";>soap:Server<
/faultcode>Server was unable to process request. --->
Authentica
tion Failed
Best Regards,
Jeff Zanzinger
RealEstateCE.com
ph: 888.895.8839
fax: 866.517.1406
http://RealEstateCE.com/
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Anyone know of a unix equivalent to win 32 function Win32::Internet
Trying to capture a web page as a string i.e.
$INET = new Win32::Internet();
$file = $INET->FetchURL("http://www.yahoo.com";;);
Thanks,
Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional com
Hi all. I'm new to perl, a new programmer, and I badly need guidance. I'm
trying to parse a config file with key/value pairs seperated by white space
and surrounded by curly brackets. It has multiple fields that look like
this:
{
Key value
Key value
}
My solution has been to parse it with som
On 6/24/07 10:42 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> You don't need to repeat the pattern by hand - the /g will do that for
> you.
>
Thanks to everyone for the replies.
I expected what you pointed out above, that /\b(w+)\s+(\w+)\s+/gs would
match every instance of the patte
This is a true beginner's question, so bear with me. I have an array of
numbers. Is there a function to tell me which is larger (or smaller?) Also,
how do I search with perldoc for a function when I don't know the name?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mai
On 9/9/07 1:54 PM, "Douglas Hunter" <[EMAIL PROTECTED]> wrote:
> Jeff wrote:
>> This is a true beginner's question, so bear with me. I have an array of
>> numbers. Is there a function to tell me which is larger (or smaller?)
>
>
> Sure. Perl'
you could always change your email
address! Just a thought.
- Original Message -
From:
David Kapp
To: [EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004
14:31
Subject: stop
Why can't you just put
export TMOUT=3600
readonly TMOUT
in /etc/profile ?
If it doesn't work, contact the vendor (IBM for AIX) for a patch.
--- "Akens, Anthony" <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm a sys-admin on an AIX (4.3) machine, and I'm trying to work
> with a vendor progra
I'm new to perl, but have a background in C.
Can someone tell me what is the difference between 'use' and 'require'? When do you
use one and not the other? Seems they both are comparable to a C header file (.h).
Thank
t why this
happens. Thanks for any help!
Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
t;;
}
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 8:11 PM
To: [EMAIL PROTECTED]
Subject: Re: Flat File Db
Jeff wrote:
>
> I'm use flat files to manage a list containing approx 25,000 records. For
> updates, I write to a temp
I've never seen this syntax before:
*/5(from line: */5 * * * * root perl /home/sites/sa/cgi-bin/test.pl)
Is that legal?!
-J
--- "Mike(mickako)Blezien" <[EMAIL PROTECTED]> wrote:
> Remove the "root per" form the command line
>
> Max Hugen wrote:
> >
> > I have a simple perl script whic
unless -e '/dir/path/file';
-or-
if ( not -e '/dir/path/file' ) {
}
-Original Message-
From: Tony [mailto:[EMAIL PROTECTED]]
Sent: 08 September 2002 10:24
To: [EMAIL PROTECTED]
Subject: file exists statement
I keeps writing this out
if (-e "/dir/path/file"){}else{
#execute
}
To
don't see the answer to this.
Thanks in advance,
Jeff
__
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
and
getting it to lookup the child-hash - it seems to me it would be way
more efficient to pass in the hash values and not bother with the
lookup?
Thanks for the feedback,
Regards
Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: 18 September 2002 18:32
To: [EMAIL PROTECTED]
Subject: RE: lots of numbers...
> You meant my $iterations = int( scalar @numbers / 3 );
> (However, the scalar cast isn't necessary)
>
> my $iterations = int(@numb
THINGS I'VE TRIED END
Executive summary: how do I define a variable in my program and have a
module use that variable definition (in a non-oo module).
Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
(sorry 'bout the duplicate - bad data)
I'm using LWP to fetch an image and attempting to save it locally.
The file is successfully created, however all it contains is:
HTTP::Response=HASH(0x8380464)
Here's the code snippet:
$file = "/home/images/$name";
open(IMAGE, ">$file") || die "unabl
things like other values for -type
(like 'd' for directory), other switches (like -name... modify the above to
catch files ending in .html with -name "*.html") and -exec and more.
Enjoy!
Cheers,
Jeff
At 02:16 PM 6/8/01 +0530, Rajanikanth Dandamudi wrote:
>Hello,
>
> I had a problem understanding what the
>expression ${1+"$@"} mean? can someone help me in
>understanding this?
That's bizarre. In what context did you encounter it?
Cheers,
Jeff
talk
about Inline.pm . You might look into it.
Cheers,
Jeff
" operator.
I don't have the original post on this computer, but I remember it
vaguely. Could it be simply modified to use -print0 and xargs -0 to get
the desired result?
cheers,
Jeff
r catch it for you. And damn all languages that
use '=' for comparison. I end up with this error creeping into code after
I've spent too much time on SQL.
Cheers,
Jeff
>##
>##set $previous site var.
>##
>if ($ENV{'HTTP_REFER
e about, will all be undef.
my %list;
@list{qw(item whatever baz bar)} = ();
Now to get the same thing as above, you can ask more directly like this:
foreach my $item (keys %possible_matches){
if(exists $list{$item}){
# do whatever
}
}
or more succinctly:
my @matches = grep {exists $list{$_}} keys %possible_matches;
Enjoy!
Cheers,
Jeff
rnate regardless?
It's not just you. :-)
Cheers,
Jeff
P.S. Using hashes will eliminate duplicate entries from both lists. My
assumption in suggesting this was that that wasn't a problem, but it is
something that should be made explicit.
Cheers,
Jeff
At 03:24 PM 6/8/01 -0700, Jeff Yoak wrote:
>Code to do what you are looking for is
thing is that I wrote that during a short break from writing important
code. I wonder what sort of nasties lie waiting...
Cheers,
Jeff
At 07:10 AM 6/9/01 -0700, Randal L. Schwartz wrote:
> >>>>> "Jeff" == Jeff Yoak <[EMAIL PROTECTED]> writes:
>
>Jeff> At 05:11 PM 6/8/01 -0500, Karen Cravens wrote:
> >> On 8 Jun 2001, at 14:33, Randal L. Schwartz wrote:
> >>
> >&
.
http://perl.faq-by-day.org/ .
Cheers,
Jeff
27;t really done much. But that doesn't stop me from promoting it or a
lot of people from seeming to find it useful. ;-)
But thank you for the compliment. I'm glad to hear it is useful to you.
Cheers,
Jeff
the biggest values in the Perl FAQ is
that it is so extraordinarily well-written and precise. Many of the web
collections I've seen in the past contain a lot of mistakes and
misinformation and I would feel bad about including something like that
unknowingly.
Cheers,
Jeff
At 06:24 PM 6/11/01 -0400, Jeff 'japhy' Pinyan wrote:
> >Can anybody suggest me how to match '@' symbol in a regexp to match e-mail
> >ids etc.
>
>I suggest you don't try to write your own email-matching regex. But just
>because you asked, use
to me
unread. Ironically, four years later he wrote to me asking why I hadn't
considered hosting the list at perl.com, which would have required
contacting him.)
>Some of these may appear in the Perl Tips list in the coming months.
Cool. What's that?
Cheers,
Jeff
omeone should point out that the
proposed problem isn't solved in any of these ways.
In another post, I mentioned Email::Valid and some other conversation
about ways to do it.
Cheers,
Jeff
>that wouldn't be caught and put other mechanisms in place to handle those.
It claims to implement the RFC "except for nested comments."
Cheers,
Jeff
the opening brace in if and loop
statements.
That breaks $y% or just $%. They still haven't found his body and all of
his code has been repaired.
Cheers,
Jeff
It looks like you have a ')' where you want a '}' there.
Cheers,
Jeff
At 03:17 PM 7/17/01 -0600, Customer Service wrote:
>Syntax error near $ENV{'REQUEST_METHOD')
>
Aborted due to compilation errors
>
> Script follows:
>#!c:/perl/bin/
ending the output
into a file for later reviewing (in case something went wrong with a script run
on cron).
I have found no documentation for it, and I searched CPAN to no avail.
?
-Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I need to pick up a file from an ftp server of the format MMDD.txt.
How can I pick up the file if the file name is different each time the
program would connect to the server?
What type of expression could I use to get the file?
Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
I've actually tried that
but when I do dir() or ls()
I get the LIST command 125 Data Connection already open;
No listing appears on the screen although I know that there are files in
the driectory.
Jeff
Bob Showalter wrote:
>> -Original Message-
>> From: Jeff
e done. Close up shop.
close SRC;
close DEST;
If you're interested in seeing how you might write this code later in your
Perl career, as you learn idioms and such, I offer:
my %seen;
open IN, $in or die "can't read $in: $!";
open OUT, "+< $out" or die &quo
sysread FILE, $buffer, 4096) {
$lines += ($buffer =~ tr/\n//);
}
close FILE;
This assumes no funny games with newline translations.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.
er of the most recently read line.
1 while ;
print $.;
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
her wasteful use is:
@lines = ;
for (@lines) { ... }
when a simple:
while () { ... }
will do.
I have an article about files and filehandling on my web site:
http://www.pobox.com/~japhy/articles/pa/2000-01.html
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pob
$x such that
$a <= $x < $b+1
And when we take the integer value of this value, it will be
$a <= $x <= $b
So there we are. Now for our function.
sub randBound {
my ($lower, $upper) = @_;
return int( rand($upper + 1 - $lower) + $lower );
}
--
Jeff "japhy"
;& $time < $_->[1]);
# last if the time is too small for the rest of the ranges
last if $time < $_->[0];
}
}
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://foru
rand 2) {
$string .= int rand 10;
}
else {
$string .= $letters[rand 26];
}
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.
called 'explain') to get an explanation of
your regex, which should help you see why it's failing.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
On May 6, Jeff Pinyan said:
>On May 7, Clinton said:
>
>>I'm tring to extract some values delimited by quotes
>>I can extract the first set using "([^"]*) but not the second set using
>>"([^"]*),"([^"]*). Could I have a clue please?
&
--
_'_'
--
)end of grouping
--
==
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.p
lso using \2 on the right-hand side (RHS) of a s///, which is not
safe. You should use $2.
s/^[A-Za-z]+_//;
does far less work.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl P
t also consider using regex objects instead of quoted strings.
%fields = (
s => qr/([0-5]\d)/,
m => qr/([0-5]\d)/,
h => qr/([01]\d|2[0-3])/,
);
$fields{t} = qr/$fields{h}:$fields{$m}:$fields{s}/;
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www
me ABC/;
Here, $abcXYZ is rendered as
(?-ismx:(?-ismx:Mon|Tue|Wed|Thu|Fri|Sat|Sun) ABC)
Perhaps it's a bit more noise, but that's how the regexes are
formed. Note the (?:...)s.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk?
that work is made somewhat simpler (backslash-wise, at least) with
the qr// operator.
Also, I'm glad to report I'm constructing an outline for a Perl regular
expressions book.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://ww
.
> 316 sub close_db
> 317 {
> 318 my ($dbref) = @_;
> 319
> 320 untie(\%$dbref);
> 321 }
Change line 320 to:
untie(%$dbref);
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com
l $/ = "\n!\n"; # so that $/ gets its normal value afterward
while () {
# do something with $_
}
}
You might want to know about the /m modifier for regexes, which makes ^
and $ not match beginning and end of a STRING, but rather, beginning and
end of a \n-line.
essage. My guess is
that there are characters in $LOCTAG and $TYPETAG that Perl is using as
regex characters. Try:
if (/\Q$LOCTAG\E/i) { ... }
if (/\Q$TYPETAG\E/i) { ... }
instead. Or, consider using index() instead:
if (index(lc, lc($LOCTAG)) > -1) { ... }
--
Jeff "japhy" Piny
F);
>> 34 $location =~ s/::$//;
>> 35 $jobtype =~ s/::$//;
>
>Lines 24, 29; perhaps you mean "=~" ?
No. Doing:
($foo) = /pattern/;
is the same as:
($foo) = $_ =~ /pattern/;
What he's doing is getting the ()'d part of the regex, and storing i
ame fs.
If the standard rename() function isn't good enough, File::Copy also has a
move() function.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at Ri
hile () {
my ($name) = /^\(\w+ = (\w+)\)$/;
print "got: $name\n";
}
That regex matches the (, and then some "word", then " = ", and then saves
the next "word" it finds.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.p
To get that to work, you'd need to backslash the quoting character:
"he said \"hi\" to me"
qq/he said \/hi\/ to me/
but that should be a sign that you should've chosen a different character.
Using qq(), qq[], qq{}, or qq<> allows you to nest the quotes
it for EVERYTHING unless you recompile Perl. You can do it
for yourself all the time by setting the PERL5LIB environment variable to
a colon-separated list of directories to add to @INC automatically.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a
p://www.pobox.com/~japhy/docs/LPRE.html
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Aca
ion of that book, and it is *four* years old.
A lot has changed for Perl's regexes in that time.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at R
On May 10, Peter Scott said:
>At 09:29 AM 5/10/2001 -0400, Kevin Meltzer wrote:
>>On Thu, May 10, 2001 at 09:17:30AM -0400, Jeff Pinyan ([EMAIL PROTECTED])
>>spew-ed forth:
>> > On May 10, Crandell, Daniel (TIFPC) said:
>> >
>> > >Same situation he
ted. Just curious if anyone
>knows what this means.
Please check the perldiag documentation, which explains this warning.
You must send -T on the command-line, because by the time Perl actually
starts RUNNING your program, it's too late to do some of the taint
checking it should have done.
x27;tr/\r//d' files...
Why use Perl if you don't have to?
japhy% tr -d '\r' < file > file.new; mv file.new file
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.pe
.
Sadly, the oct() and hex() functions are poorly named; they should be
from_oct() and from_hex(). You want to use sprintf().
$as_hex = sprintf "%x", $num;
$as_hex = sprintf "%#x", $num; # adds a leading "0x"
--
Jeff "japhy" Pinyan [EMAIL PR
On May 10, Paul Cotter said:
>print dtcnvx('Ab c') # gives 41622063
Ohh. Oops.
$x = unpack 'H*', 'Ab c';
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/
= $b =~ /\@([^:]+)/ if not exists $cache{$b};
$cache{$a} cmp $cache{$b}
} @orig;
You can read about these two at:
http://www.pobox.com/~japhy/docs/sorting.html
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
On May 10, Jeff Pinyan said:
> {
>my %cache;
>@new = sort {
> ($cache{$a}) = $a =~ /\@([^:]+)/ if not exists $cache{$a};
> ($cache{$b}) = $b =~ /\@([^:]+)/ if not exists $cache{$b};
> $cache{$a} cmp $cache{$b}
> } @orig;
}
--
Jeff "
On May 10, Peter Scott said:
>At 05:55 PM 5/10/01 -0400, Jeff Pinyan wrote:
>>That sorting method does a lot of work -- that is, it does things more
>>than once. I suggest you use a schwarztian transform, or the Orcish
>>manuever, to increase speed.
>
>I'd lik
name always helps me remember things like that. Thanks.
Joseph Hall (author of "Effective Perl Programming") coined the term
"Orcish maneuver", because in essence, it's supposed to look like:
$cache{$a} ||= function($a);
$cache{$b} ||= function($b);
So it's "OR&quo
\)? ')' (optional (matching the most amount
possible))
--
)end of grouping
--
--
Jeff
On May 11, FLAHERTY, JIM-CONT said:
>$test1 = s/<>//g
^
This gives an error.
s!<>!!g;
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl
# not BDSM_File ;)
use Fcntl; # for O_CREAT and O_RDWR constants
tie my(%db), SDBM_File => (
$filename,
O_CREAT | O_RDWR, # file flags
0666, # permissions
) or die "can't tie to $filename: $!";
for my $key ($cgi->param) {
$db{$key
le to 0 bytes
truncate FILE, 0;
# spit information out in readable form
for (sort keys %records) {
print FILE "#$_\n", @{ $records{$_} }, "\n";
}
close FILE;
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk?
On May 13, Jeff Pinyan said:
>if (/(?:^|\@)(\S+)/) {
I had a precedence error in my code here. That regex will match at the
beginning of the line every time. It should be:
if (/\@(\S+)/ or /(\S+)/) {
# ...
}
Sigh. And I'm writing a book about these. I should ge
. I had originally had two regexes, and then I
concatenated them, terribly incorrectly.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Gr
use mkdir() and rmdir().
Although it requires you to create a lock file, it's atomic and safe.
sub lock {
1 until mkdir "$_[0].lck", 0777;
$locked{$_[0]}++;
}
sub unlock {
rmdir "$_[0].lck";
delete $locked{$_[0]};
}
END {
rmdir "$_.lck" f
On May 14, Peter Scott said:
>Ooh, that is clever. Has it been encapsulated in a CPAN module?
No. It can break on NFS.
>> 1 until mkdir "$_[0].lck", 0777;
>
>Perhaps sleep 1 until mkdir would be a little less stressful on the average
>system :-)
Feh.
#x27;re on an NFS, all
bets are off.
The Perl Cookbook mentions the mkdir+rmdir locking scheme. I think that's
a pretty safe bet.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlgu
_alt($1)/eg;
sub add_alt {
my $tag = shift;
substr($tag, -1, 0, ' alt="FOO!"'); # insert alt attr.
return $tag;
}
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
while (defined($x = )) {
'???';
}
while ($x and ) {
'???';
}
while ($x and $y = ) {
'???';
}
Those last two can't be optimized to a simple assignment from , so
Perl doesn't do its magical change.
--
Jeff "japhy" Pinyan
the most amount possible))
--
)end of \1
--
)end of grouping
------
has a non-false value, else ''
> $a || $b # returns $a if nonfalse, else $b if nonfalse, else ''
That is misinformation.
#!/usr/bin/perl -l
print (10 || 100);
print (10 or 100);
__END__
10
10
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http
atched in nested blocks that have
been exited already. (Mnemonic: like \digits.)
These variables are all read-only.
Example:
if ($line =~ /^(\w+)\s*=\s*(.*)/) {
print "setting '$1' to '$2'\n";
$config{$1} = $2;
}
--
Jeff
nd in /usr/local/lib/perl5/5.6.0/pod/perlfaq4.pod
How can I remove duplicate elements from a list or array?
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at Ris
ULD have used for variables.
($variable) = getNextRule();
$data{$variable} = [ ... ]; # create an anonymous array
Now, instead of looking at @$variable, look at @{ $data{$variable} }.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
that holds references to $foo, @foo, %foo, and &foo (and a bit more).
You can treat a typeglob as ANY sort of reference! So...
- if $SymbolTable::{$name} returns a typeglob...
- and a typeglob can be dereferenced to anything...
- then ${ $SymbolTable::{$name} } is like...
- $SymbolTable
a
no-no. You need to use 'eq'.)
You might think it's overkill, but I might use a hash if there are a lot
of values.
my %valid_x;
@valid_x{'a', 'test', 'return', 'x-return'} = ();
if (exists $valid_x{$x}) {
# ...
}
--
Jeff "japh
$subject .= ($ret eq 'o.k.' ? " -OK- " : " -FAILED- ");
$subject .= (" -FAILED- ", " -OK- ")[$ret eq 'o.k.'];
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/
1 - 100 of 2699 matches
Mail list logo