newlines,
and add that to your running total.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
it will match as many times as it can (due to the /g modifier).
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org
On Dec 1, Andrew Brosnan said:
my $var = 'world';
my $data = DATA;
__DATA__
hello $var
Read 'perldoc -q expand'.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long
| {} |,
$string
;
does what you want. See the module's documentation for details.
You'll have to download the module from CPAN, since I highly doubt you
already have it.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every
]=ASDFGHJK, and @LargeArray[2]=SDFGHJKL
So you want to get OVERLAPPING matches, is that correct? If so, your
problem can be solved with a look-ahead assertion:
my @matches = $string =~ /(?=($pattern.{8}))/g;
The look-ahead matches without advancing in the string.
--
Jeff japhy
:
while (my @row = get_stuff_from_database()) {
# assuming $row[0] is abc or def or ghi
# that is, $row[0] holds the nickname of the function
my $code = $functions{$row[0]};
$code-(@arguments);
}
So when $row[0] is 'abc', we call do_this(...). Etc.
--
Jeff japhy Pinyan
for result code to indicate success/failure/virus found etc
# if virus, return lines reporting it from @output
# use map/grep/whatever to extract lines.
}
That's all I have to say about that.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated
the path is empty, instead of calling add_path() again, we set
$_[0] to 1.
This means that $hash{A}{B}{C}{1}{5} is set to 1.
This can be done WITHOUT a recursive function. Exercise to the reader.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734
as [\d\w|+] which is the same as [\w|+] anyway, since \w
includes \d.
So you could do:
perl -00 -ane 'print $F[2] if $F[4] =~ /porn/' ...
The -a switch autosplits $_ into @F on whitespace.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734
, followed by a ']' with 'N'.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e
($string, 6, 2) . substr($string, 0, 4)
The first argument is the OFFSET, and the second argument is the LENGTH.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been
On Nov 17, Pine Yan said:
#!/home/gnu/bin/perl
use LWP;
my $browser = LWP::UserAgent-new;
my $url = 'http://www.google.com';
my $response = $browser-get($url);
You didn't load the LWP::UserAgent module, though. You loaded LWP, not
LWP::UserAgent.
--
Jeff japhy Pinyan% How can
On Nov 16, Paul Johnson said:
On Tue, Nov 15, 2005 at 06:48:40PM -0500, Jeff 'japhy' Pinyan wrote:
whereas if $_[1] is tainted, then the eval { ... } returns false since a
fatal error is raised because
eval 1 . substr($_[0], 0, 0)
is illegal if $_[0] is tainted.
I would be wary of even
if $_[0] is tainted.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL
.
It prints the NAME of the file. But that file doesn't exist in the
current directory, it exists in the SCRATCH/BACKUP directory. You need to
prepend the directory path to the filename:
foreach (@files) {
my $ctime = (stat SCRATCH/BACKUP/$_)[10];
}
--
Jeff japhy Pinyan% How can we
;
}
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED
{
print $sku[$i-1],', totaalaantal is ',
$t_qty[$i-1]\n;
}
}
}
}
I believe the } above is the one matching your foreach statement.
}
$sth-finish;
$dbh-disconnect;
--
Jeff japhy Pinyan% How can we ever
, you're running the same
code TWICE (once for each element in @result).
1989, totaalaantal is 5
1989, totaalaantal is 5
4121, totaalaantal is 1
4121, totaalaantal is 1
Yup. Tweemaal.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated
On Nov 4, JupiterHost.Net said:
I'm beating my head against the wall trying to remember where I saw this
/ how to do this:
In some documentation I remember seeing a use statement that had some sort of
condition.
use if ...;
perldoc if
--
Jeff japhy Pinyan% How can we ever
you have the number of seconds in $gmtime. Subtract 8 hours by
subtracting 60*60*8 seconds from that.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid
} = dclone($aSuit{0});
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail
= @{ $aref };
What are you doing that leads you to believe you'll need a special marker
of some sort to indicate that an array has been processed?
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http
just use \Q...\E in the regex:
my $splito = $dynparsparts[0];
...
my @parts = split /\Q$splito\E/, $problem;
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been
. (Guilt-free, I might add.)
I'd suggest going to search.cpan.org and looking for HTML:: which should
yield several matches. I think HTML::TokeParser (or
HTML::TokeParser::Simple) would be your best bet here.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother
. That's weird. I don't use a Mac,
though, so I can't be sure.)
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister
(\.) and digits after it.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL
no idea.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL
.
P.S. My last name is Pinyan (awfully close to your full name). It's
pronounced the same way, I'm told, as pinyin, the process by which
Chinese characters are transliterated into English words.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734
' from $data, but you don't know how to get
'RecordNumber' from $data-{CreateLock}?
my $rec = $data-{CreateLock}-{RecordNumber};
# or, without the extra -
my $rec = $data-{CreateLock}{RecordNumber};
The object is merely a hash of hashrefs (of hashrefs, etc.).
--
Jeff japhy Pinyan
opinion. Those should be set up as methods of
the object. :(
The idiom:
package Class::Subclass;
use base 'Class';
1;
should be universal, no?
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http
map() in void context), you're wasting resources. If
you do
map BLOCK LIST
and don't intend on saving the return value of map(), just use a for loop.
for (LIST) BLOCK
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who
() is even better.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL
Conway's
name spelled properly, and Randal (L.) Schwartz's name spelled properly,
etc. I see Damien and Randall constantly.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have
references.
Here's what it's like:
@records = (
# email 1
{
SENDER = '...',
RECIPIENT = [ '...', '...' ],
SMTP = '...',
# whatever other fields you want
},
# email 2
{ ... },
);
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI
();
kill 1,$fPID;
That's sending it a HUP signal. Do you expect PROGRAM to die when it
receives the HUP signal?
kill 9,$fPID1;
NOW it should die, since 9 is KILL.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we
. :)
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED
?
The Curses module is probably a good starting point. It gives you control
over the terminal displays.
Curses! Foiled again!
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long
?
Or can I simply embed that module within my script somehow?
It's not that easy. Curses is a wrapper around a bunch of C functions and
what-not. I don't know what the simplest non-Curses way of controlling a
terminal is.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI
)
You're misunderstanding the /x modifier. Using /x means that all
whitespace in your regex is ignored, not that all whitespace in the STRING
is ignored. Only roamact is matched by /roam act/x, since the in
the regex is ignored due to the /x modifier.
--
Jeff japhy Pinyan% How can we
as
perl myprog.plroamact
both of which create TWO arguments, one 'roam', and the other 'act'.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid
On Oct 19, kathyjjja said:
$ftp = Net::FTP-new(aaa.bbb.org, Debug =0) or die Cannot connect to
aaa.bbb.org: $@;
$ftp-ascii
$ftp-login(login,passwd) or die Cannot login, $ftp-message;
You missed the semicolon after '$ftp-ascii'.
--
Jeff japhy Pinyan% How can we ever be the sold
summary of their purpose. You should see 'perlrun' listed as the one
describing the command-line options to perl.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been
On Oct 19, Randy W. Sims said:
Jeff 'japhy' Pinyan wrote:
On Oct 19, Brian Volk said:
Is there a perldoc that will list the available arguments and there
meanings
for perl-one-liners?
Yes. To try and figure out what perldoc to look at for a given topic, do:
perldoc perldoc
You mean
(), because you can't
modify a constant string:
trim( hello ); # run-time fatal error
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http
. In the future, please determine the appropriate list for your
questions.
$statement = q{
SELECT *
FROM some_table
ORDER BY votes DESC
LIMIT 1
};
That will get you one row back, the row with the highest votes.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI
On Oct 14, Charles Farinella said:
Does anyone know how I can search for non-ascii characters in a text
file?
By non-ASCII, do you mean characters high-bit ASCII or Unicode?
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who
to use double-quotes around
the entire string and escape whatever shouldn't be interpolated:
$xp-findnodes(/navigator/nav_group/[EMAIL PROTECTED] = '$script']);
Try that. I don't see anything explaining the syntax of an XML path, so I
don't really know what *I'm* doing.
--
Jeff japhy
::RecDescent.
For written language parsing, those are located in the Lingua:: hierarchy
on CPAN.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http
allow for a newline at the end of the string, whereas \z does
not. Perhaps, though, it's overkill, since you're already making sure
$match only has 3 characters.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
($text3).
Perhaps if you put something in $text3 FIRST, and THEN tried s///'ing it.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http
? By telling it so, with the 'lib' pragma:
#!/usr/bin/perl
use lib /home/japhy/modules;
use MySpecialModule; # /home/japhy/modules/MySpecialModule.pm
Read 'perldoc lib'.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who
/;
push @info, $answer;
}
And then you loop through it like so:
for my $idx (0 .. $#info) {
print $idx + 1, : $info[$idx]\n;
}
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org
shuffle
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED
to skip lines that only have whitespace characters, then you
can do:
while (FH) {
chomp;
next unless /\S/;
}
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long
.connectionType_changed_changed
by making sure that the Ethernet0.connectionType is not followed by
_changed -- that's what the (?!_changed) part of the regex is doing.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http
{$a} and $message{$b}. To sort my the 'To_Num' field,
then, you would do:
sort { $message{$a}{To_Num} = $message{$b}{To_Num} } keys %message
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org
. '\' is a BACK slash. Here are two solutions to
your problem:
my @dirs = split /\//, $cd; # splitting on forward slashes
my @dirs = split '/', $cd; # same thing, less ugly
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who
it; that's how
we put something in $ORACLE_SID other than '1'.
($ORACLE_SID) = $basename =~ /_([A-Z]+)-/;
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been
.. are. If that fails, try # \x0c \x01, which is
using actual hexadecimal escape sequences to produce character 10 and
character 1.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org
from there.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL
}++;
# test printout
print $sku [$hash{$sku}]\n if $verbose;
You don't really need $sku here... but you can use it if you wish.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http
as $login:$pass: $@;
as the documentation for the module suggests. $@ will hold the reason for
the failure.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been
} and $$array[$idx].
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL
to [$value]br; #Debug
}
}
Blech! Please, please, PLEASE use CGI.pm for your form-parsing needs.
It's standard and it works, and it handles things like multiple-value
select-boxes (which get_form_data_1() does not).
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI
but
sometimes confusing as hell (to me at least).
Consider reading 'perldoc perlreftut', a tutorial to using references.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago
to address this
situation :(
I would use map() before and after sort() to correct leading characters.
my @sorted =
map { tr/123/QBZ/; $_ }
sort
map { tr/QBZ/123/; $_ }
@data;
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734
On Oct 3, Xavier Noria said:
On Oct 3, 2005, at 18:16, Jeff 'japhy' Pinyan wrote:
my @sorted =
map { tr/123/QBZ/; $_ }
sort
map { tr/QBZ/123/; $_ }
@data;
There's a potential gotcha there: since all Qs and Bs are being swapped
lexicographic order after the first character
they are in order of Q, B , then Z
Any ideas or input on how to efficiently do that with sort() or even
map() is most appreciated :) perldoc -f sort|-f map didn't appear to
address this situation :(
Jeff 'japhy' Pinyan wrote:
I would use map() before and after sort() to correct leading
characters
your global variables:
use strict;
our ($foo, @foo);
$foo = ...;
@foo = ...;
testsub(*foo);
sub testsub {
our ($x, @x);
*x = $_[0];
$x++;
push @x, 100;
}
But this is really inadvisable. What is your motivation to do this kind
of thing?
--
Jeff japhy Pinyan
wrong here.
my @ary = ();
That's doing nothing -- you're creating a NEW lexical named @ary. Drop
the my(), but I'm not even sure it's necessary.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
{$_} : ()
} @original_array;
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL
the directory $path in the array @files. The
number of elements is the number of files.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http
to do this on your own, and yes, recursion is
the most obvious way to do it.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org
\n;
$matched = $matches;
$matches = 0;
Where did $matched come from?
}
}
}
}
close (OUTPUT);
close (OUTPUT2);
}
You should not use any variables in a function that you did not pass to it
or create IN it.
--
Jeff japhy Pinyan% How can we
) {
You're using the /o modifier here, and that's causing your problem. I'm
guessing you don't actually know what the /o modifier does. It tells Perl
the regex won't change after it's been compiled the first time. Remove
the /o modifier and I believe your code will run fine.
--
Jeff japhy
that expression is returned.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail
On Sep 23, Ryan Frantz said:
From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]
foreach my $process (in $sobj-InstancesOf(Win32_LogicalDisk)) {
next if $ignoreDriveTypes{ $process-{DriveType} };
So this would evaluate to true if $process-{DriveType} matches a key in
the hash?
It would
* Perl
has seen its prototype.
Long story short: don't use prototypes.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org
returned by `my_utility` that have 'manish' in them:
my @wanted = grep /manish/, `my_utility`;
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http
On Sep 23, Frank Geueke, III said:
text immediately following the variable name. How do
I tell Perl that the text is not part of the variable
name? Here's my code:
You wrap the *name* of the variable in braces:
print ${get_to_index}css/hotspot.css;
--
Jeff japhy Pinyan% How can
platforms come with a program called 'dos2unix' or something
similar. You don't really need Perl to do this. A simple 'tr' command
will work:
tr -d '\r' '' file.in file.out
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who
, not
the $process foreach loop. You'd have had to put a label on the outer
foreach loop like so:
PROCESS: foreach my $process (...) {
foreach (...) {
next PROCESS if ...;
}
...
}
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734
') ?
display_nothing() :
display_something();
is like saying
if ($match_type eq 'none') {
display_nothing();
}
else {
display_something();
}
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http
-of-string anchor, so there's no
way an 'i' can match after it. Were you hoping the '$i' would be expanded
to the current value of the $i variable?
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http
{ }
around the statement:
$result = do { do_this() if that(); };
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org
On Sep 22, Michael Gale said:
Jeff 'japhy' Pinyan wrote:
On Sep 22, Michael Gale said:
I have the following line of code and I believe it is correct, but it is
not doing what I am expecting it to do:
Config file
[test]
value=^OK$i
The problem is that '^OK$i' as a string turned
if you're going to be using
multidimensional hashes).
Look for either module on CPAN (http://search.cpan.org/).
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been
.
There's no bug. You're doing something wrong. If you show us a bit more
code, that demonstrates how you're using the function, we might be able to
help more.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
type. To get the scalar variable found in the glob, you have
to dereference the glob as if it were a scalar:
my $g = $main::{$Player{Location} . ::}{Options};
my $value = $$g;
or, as one line:
my $value = ${ $main::{$Player{Location} . ::}{Options} };
--
Jeff japhy Pinyan% How
On Sep 19, Luinrandir said:
From: Jeff 'japhy' Pinyan [EMAIL PROTECTED]
my $g = $main::{$Player{Location} . ::}{Options};
my $value = $$g;
or, as one line:
my $value = ${ $main::{$Player{Location} . ::}{Options} };
is the double $$ in $$g a mistake or real?
If it was a typo
', whereas $hash-{$key} means that you have a hash reference stored
in $hash. Your print() line, therefore, should be:
print keys %{ $ref_allTariffData-{$filename} };
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every
.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED
/perl
use CGI;
$query = CGI-new;
$which_box = $query-param('some_radio_button_name');
@colors = $query-param('some_check_box_name');
and it's taken care of for you.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who
, array, hash, etc.), we do $glob-(ARGS).
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
until the first 12 had been sent.
The extreme cases are the easy ones, though. What I'd like to see are
cases like:
foo = 1
bar = 2
qux = 3
baz = 4
zip = 5
Once I know what the algorithm's outcome should be for something like
that, I think I can develop it.
--
Jeff japhy Pinyan
us WHICH of those
lines produced the warning message.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister
the IPC::Open3 module, which comes with Perl.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
the (NUMBER) part optional
without causing $2 to be undef if it isn't matched.
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org
:]]+$/) { ... }
--
Jeff japhy Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ %-- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL
1 - 100 of 1486 matches
Mail list logo