n it, count its 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/ %
On Dec 1, Andrew Brosnan said:
my $var = 'world';
my $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.pe
instead of scalar context), so
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 bee
better fashion.
use Perl6::Form;
print form
"| {} |",
$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
ng in $_
print qq{"$_",};
}
The qq{...} is a double-quoted string; that is, it's the same as "..."
except that it doesn't use " to delimit the string, but rather { and }.
This isn't a perfect solution for you, though, because it keeps a t
.
--
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 PROTE
p;... things are REFERENCES to functions. So you do:
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 'a
, when 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
, either parenthesize specifically, or avoid trouble
by using the loosely-binding 'or' operator:
chdir($ARGV[0]) || die ...;
chdir $ARGV[0] or die ...;
foreach my $engine (%engines) {
You're looping over the keys AND values of the hash. You mean to say
foreach my $engine (k
*porn/m }'
Your regexes are funky. First of all, [...] is for CHARACTERS. [\d+|\w+]
is the same 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 w
es a '[' followed by A's, C's, T's,
and/or G's, 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.perlm
) . substr($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.or
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 "j
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 wa
false
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.
--
Jeff "japhy" Pinyan% How can we ever be the sold short or
RPI Acacia Brother #734% th
quot; print $_ " successfully prints out the files in
SCRATCH/BACKUP dir.
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) {
mplest
way to do this is:
if ("123" =~ /1.*3/) {
print "found 1...3\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 lon
if($i==$n){
print "$sku[$i-1]",', totaalaantal is ',
"$t_qty[$i-1]\n";
print "$sku[$i]",', totaalaantal is ',
"$t_qty[$i]\n";
}
else {
level deep. For generic copying of data
structures, see the Storable module (comes with Perl):
use Storable;
$aSuit{1} = 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
h
t;2005-11-02 01:36:00.0", "UTC");
Now 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 s
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
uld've used $i to
fill in the placeholder.
foreach (my @result = $sth->fetchrow_array) {
That is certainly incorrect. I think you just want to do:
my @result = $sth->fetchrow_array;
and dispense with the loop entirely. Otherwise, you're running the same
code TWICE (once
$size = @{ $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 fo
to/, $problem;
or to keep $splito normal, you can 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 f
optionally
allowing for a decimal point (\.) 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/
f
the line.
(Except maybe on Macs, I don't know. 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
ht
off
using a module to do it for you. (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
rsing this format, I have absolutely
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
tes any regex-related characters, so that they're
matched literally.
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"
That's poor planning, in my 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 Brothe
*Question:* How do I get the value of RecordNumber?
You knew how to get 'CreateLock' 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 =
val . And as
John has shown, join() 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/
ilds a list to be returned, and by not USING its return value
(that is, calling 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" Piny
ly appreciate seeing Damian 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% th
= findPID();
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 Broth
etc.
}
Now you have an array, @records, whose elements are hash references.
Here's what it's like:
@records = (
# email 1
{
SENDER => '...',
RECIPIENT => [ '...', '...' ],
SMTP => '...',
# whatever other
hines?
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
rent
terminal?
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
is
not much to talk
about.
^P
Here is a "long" paragraph, but I only mean that the
length of its lines are considerably longer.
^P
And here
is the last
paragraph
which I have
made taller
than all the
other ones.
Remember when
paragraphs were
more than two
sentences long?
===
cumentation! Let the
author know. :)
--
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
--
T
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
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.or
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
s the same 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://w
ct/ix)
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.
--
Jef
rint "[EMAIL PROTECTED]"; # [this and that]
Of course, you can't send an ACTUAL string to trim(), 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
27;t see anything explaining the syntax of an XML path, so I
don't really know what *I'm* 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://www.perlmonks.org/ % ha
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 c
but I will answer it
for you. 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
you that
you're using an uninitialized value ($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
htt
mean "end of string", except
that $ can 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 sho
::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 over
a non-whitespace character in it
$answer = "-" if $answer !~ /\S/;
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
e for a
module?" 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
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
e () {
chomp;
next if $_ eq "";
...
}
If you want to skip lines that only have whitespace characters, then you
can do:
while () {
chomp;
next unless /\S/;
}
--
Jeff "japhy" Pinyan% How can we ever be the sold short or
RPI Acacia Brothe
ting -- this means they're
two keys from %message. This means the ONLY place it makes sense for them
to be is $message{$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 &
27;t change
"Ethernet0.connectionType_changed" to "Ethernet0.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" Pinya
)
or die "couldn't connect to $imaphost 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
$sku = $array[0];
$hash{$sku}++;
# 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
guide you 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 unsubsc
he Net::SNMP docs only
show ONE example of using OCTET_STRING, and I'm not really sure what its
rules about using "0x.." are. If that fails, try "# \x0c \x01", which is
using actual hexadecimal escape sequences to produce character 10 and
character 1.
--
Jeff "japhy&q
;ve added
tell Perl to capture what it matched with [A-Z]+ and return 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
a FORWARD slash. '\' 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
l feature 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:/
hash <-
Deprecated stmt
print "get_form_data_1: Setting $key to [$value]"; #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
>[$idx], or $$hash{$key} 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/ %-- Meiste
or Z
>>>
>>> I need to sort them so 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 situati
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
ar 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 o
onsume) for the following
pattern ...".
--
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/ %--
this is really inadvisable. What is your motivation to do this kind
of thing?
--
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://princ
ot;, \"${ary[18]}\",
\"${ary[19]}\", \"${ary[20]}\", \"${ary[21]}\", \"${ary[22]}\",
\"${ary[23]}\", \"${ary[24]}\", \"${ary[25]}\", \"${ary[26]}\",
\"${ary[27]}\", \"${ary[28]}\", \"${a
the files from 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 lon
{$_} : ()
} @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-ma
got no
idea about it right now. and sorry for my bad english, hope i can make
my problem understandable.
It would be a fun exercise 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
UT2 "$ip1\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"
27; => 60,
'tom' => 50
};
QUESTION: Does this mean that $grades is an anonymous reference
because perl gives is $VAR1?
No, it's just what Data::Dumper outputs when you don't assign a name to
the data structure you pass it. See the Data::Dumper docs.
handler). If there is an error or warning, the expression itself is
returned; otherwise, the returned value from 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
the /o modifier and I believe your code will run fine.
--
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 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} ma
$type ( keys %ignoreDriveTypes ) {
next if ( $process->{DriveType} == $ignoreDriveTypes{$type} );
}
Here was the problem. This 'next' was working on THIS foreach loop, not
the $process foreach loop. You'd have had to put a label on the outer
foreach loop like so:
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 so
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&q
ments 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/ % ha
But this is never noticed because you've called the function *before* 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 f
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/ % hav
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
his());
$result = (that() && do_this());
However, you can turn any statement into an expression by using do { }
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% t
' is the end-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 Brothe
operator:
($match_type eq 'none') ?
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 Aca
this a bug.
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
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 dou
to
every data 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} . "::"}{Optio
hash for @result instead of the array like I
did.
--
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/ %-- Meist
%hash', 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
r/bin/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
string to
uppercase.
perldoc -f uc
--
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
b, a reference to every
type (scalar, 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://p
pl"; # loading, for example, Inn.pl
Now you want to call the Inn::HTML() function, right? You can't easily do
it if strict is turned on. Here's one way, though:
my $glob = $main::{$Player{Location} . "::"}{HTML};
$glob->();
--
Jeff "japhy" Pinyan
1 - 100 of 1591 matches
Mail list logo