age->GetPixels(map=>'I',
>> height=>$height,width=>$width,normalize=>true);
>> binmode STDOUT;
>> print pack('B*',join('',@pixels));
>>
>> # Other clever things you can do with a PerlMagick objects include
>> $i = "$#$p+1"; # return the number
int pack('B*',join('',@pixels));
>
> # Other clever things you can do with a PerlMagick objects include
> $i = "$#$p+1"; # return the number of images associated with object p
> push(@$q, @$p); # push the images from object p onto object q
> @$p = (); #delete the images bu
The issue isn't having the method, the issue is calling it on an unblessed
reference. Can you show the code that gives this problem?
Btw, my bet is that it's not a matter of having PDL's method. You would use
PDL for number crunching, not gif animation. :-)
David
On Fri, Feb 4, 2022, 10:14 AM
result is wrong.
Can't call method "Convolve" on unblessed reference at gifaninmation.pl
> line 47.
>
I don't know in what part I am confused.
On Fri, Feb 4, 2022 at 8:34 AM Andrew Solomon wrote:
> Is this what you're looking for?
>
> https://metacpan.org/pod/PDL::Imag
Is this what you're looking for?
https://metacpan.org/pod/PDL::ImageND
On Fri, Feb 4, 2022 at 2:30 PM William Torrez Corea
wrote:
> I'm using cpanm trying to find a method that contains the function
> convolve but I only found the method Imager.
>
> https://metacpan.org/pod/Imager
>
> When I
I'm using cpanm trying to find a method that contains the function convolve
but I only found the method Imager.
https://metacpan.org/pod/Imager
When I try to declare the method and use it in the code, the result is
always wrong.
I am using the following libraries:
>
>
>
>
for Artifactory-Client: zero length file uploads
https://rt.cpan.org/Public/Bug/Display.html?id=97772
'expect' = '100-continue' undefined value as a SCALAR reference #63
https://github.com/libwww-perl/libwww-perl/issues/63
if(defined($wbits)) is giving me can't use and undefined value as a SCALAR
with gnuplot:
plot (./siggen -f cos -p 2 -n66 ) lc 1
to get a nice curve.
Unfortunately, though, I was only able to get it to work as symbolic reference.
First I tried:
$f = \Math::Complex::$func;
Scalar found where operator expected at ./siggen line 194, near
Math::Complex::$func
On 24/06/2012 19:51, Rob Dixon wrote:
or by aliasing the current package's 'sin' and 'cos' subroutines with
the CORE functions:
use strict;
use warnings;
use Math::Trig;
BEGIN {
no warnings 'once';
*sin = \CORE::sin;
*cos = \CORE::cos;
}
Thank you. The useful note about CORE, in particular, is new to me.
cts
--- On Sun, 6/24/12, Rob Dixon rob.di...@gmx.com wrote:
From: Rob Dixon rob.di...@gmx.com
Subject: Re: how to do a reference to a func in Math::Trig
To: Perl Beginners beginners@perl.org
Cc: Charles Smith cts.priv
;
Undefined subroutine Math::Trig::sin called at (eval 10)...
$f = \sin;# just delays the problem
etc.
Can anyone tell me how to take a reference to func in a module?
TIA
cts
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners
On 12-06-23 10:12 AM, Charles Smith wrote:
I'm experimenting with Math::Trig and would like to be able to pass the
function in as a parameter:
$f = $opts{f} || sin;
$f = $opts{f} || \sin;
See `perldoc perlreftut` and `perldoc perlref`.
--
Just my 0.0002 million dollars worth,
Hello Shawn, thank you for answering.
I'm sorry, I was a bit sloppy with my example and so maybe unclear about my
question ...
It's not about the precise syntax of getting a reference to a subroutine, but
rather a subroutine in a module.
For example, this pgm is clear:
#!/usr/bin/env perl
Charles Smith wrote:
[snip]
But this pgm fails:
#!/usr/bin/env perl
use Math::Trig;
my $a = \Math::Trig::cos;
$a(0);
Undefined subroutine Math::Trig::cos called at modfunctor line 7.
The cos sub is defined in Math::Complex, which Math::Trig loads.
Try this:
use strict;
use
1
to get a nice curve.
Unfortunately, though, I was only able to get it to work as symbolic reference.
First I tried:
$f = \Math::Complex::$func;
Scalar found where operator expected at ./siggen line 194, near
Math::Complex::$func
(Missing operator before $func?)
syntax error
On May 20, 2012, at 8:28 AM, Shlomi Fish wrote:
The problem is that «$self-animals» returns an (unblessed) array reference
and
not the list of individual animals, so you should do something like:
for my $animal (@{ $self-animals }) {
Thanks, Shlomi. That did it. Moose is a new
Hi Marc,
On Sat, 19 May 2012 20:09:00 -0700
sono...@fannullone.us wrote:
I'm trying the following code from Programming Perl, but I'm get the
error Can't call method type on unblessed reference at untitled text 10
line 23. I've checked the errata page, but there's nothing listed
On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote:
Note that I think I saw a way to return the flattened array in Moose,
but I don't remember the specifics.
auto_deref = 1
--
Peter Scott
http://www.perlmedic.com/ http://www.perldebugged.com/
On Sunday, May 20, 2012 at 9:28 PM, Peter Scott wrote:
On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote:
Note that I think I saw a way to return the flattened array in Moose,
but I don't remember the specifics.
auto_deref = 1
… which is semi-deprecated/recommended to avoid
On Sun, May 20, 2012 at 21:44:29 -0400 , John SJ Anderson wrote:
On Sunday, May 20, 2012 at 9:28 PM, Peter Scott wrote:
On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote:
Note that I think I saw a way to return the flattened array in Moose,
but I don't remember the specifics.
I'm trying the following code from Programming Perl, but I'm get the
error Can't call method type on unblessed reference at untitled text 10 line
23. I've checked the errata page, but there's nothing listed for it.
Searching on the error message brings up pages about unblessed
On 01/13/2012 07:25 PM, Parag Kalra wrote:
my $obj = FooBar-new;
$obj-{'new_key'} = 'some_value'
Now I am not sure if that is the correct way of inserting a new data
structure into an already bless reference
1. FooBar may or may not be implemented as a hashref.
2. It's not wise to muck
if that is the correct way of inserting a new data
structure into an already bless reference
My aim to use this data structure across the script and FooBar through the
object -$obj once added.
This could cause problems if a new version of FooBar starts using
new_key. Instead, create your own object that has
structure into an already bless reference
My aim to use this data structure across the script and FooBar through the
object -$obj once added.
于 2012-1-14 11:25, Parag Kalra 写道:
use FooBar;
my $obj = FooBar-new;
Do something
...
$obj-{'new_key'} = 'some_value'
Now I am not sure if that is the correct way of inserting a new data
structure into an already bless reference
I don't think you should modify the blessed
On 20/11/2011 04:14, Chris Charley wrote:
Well, if Dr Ruud is right, and you shouldn't replace the undefs in the
original arrays, then the following program wouldn't be correct. It
changes the original array (data).
On 20/11/2011 00:23, Dr.Ruud wrote:
Unless you really want to change your
Unless you really want to change your data, use map().
Ruud didn't say that you shouldn't change the data, only that you should
use map unless that was what you wanted. Who knows what the OP wants.
Rob
Sorry for the delay.
What Shlomi Fish mentioned was I wanted. Thanks for all your
On 19/11/2011 18:21, Mohan L wrote:
Dear all,
#!/usr/bin/env perl
#dummy.pl
use strict;
use warnings;
use Data::Dumper;
my $ref_to_AoA = [
[ fred, barney,undef,pebbles, bambam, dino, ],
[ homer,undef,bart,undef, marge, maggie, ],
[ george, jane,undef,
Mohan L wrote in message
news:cadihtmt4rqntknjlgsimpgqv9xuc89dryhtx00ctwbknxwd...@mail.gmail.com...
Dear all,
#!/usr/bin/env perl
#dummy.pl
use strict;
use warnings;
use Data::Dumper;
my $ref_to_AoA = [
[ fred, barney,undef,pebbles, bambam, dino, ],
[
Dear all,
#!/usr/bin/env perl
#dummy.pl
use strict;
use warnings;
use Data::Dumper;
my $ref_to_AoA = [
[ fred, barney,undef,pebbles, bambam, dino, ],
[ homer,undef,bart,undef, marge, maggie, ],
[ george, jane,undef, elroy,undef,judy, ],
];
print Dumper
Hi Mohan,
On Sat, 19 Nov 2011 23:51:19 +0530
Mohan L l.mohan...@gmail.com wrote:
Dear all,
#!/usr/bin/env perl
#dummy.pl
use strict;
use warnings;
use Data::Dumper;
my $ref_to_AoA = [
[ fred, barney,undef,pebbles, bambam, dino, ],
[ homer,undef,bart,undef, marge,
On 2011-11-19 19:21, Mohan L wrote:
But What I want is, I want to replace all 'undef' to a string 'foo'.
Unless you really want to change your data, use map().
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
but
exactly how are the $value reference and $class related?
TYIA, blawson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
is happening here. The class name is returned
but
exactly how are the $value reference and $class related?
Read the documentation for bless: 'perldoc -f bless'
bless REF,CLASSNAME
bless REF
This function tells the thingy referenced by REF that it is now
Thank you for your help Rob.
How can I write a code to go to next iteration of the foreach loop if there is
a Cannot bind a reference error?
Thanks,
Jeffrey
Date: Sun, 2 Oct 2011 01:54:38 +0100
From: rob.di...@gmx.com
To: beginners@perl.org
6, 2011 at 1:03 PM, Jeffrey Joh johjeff...@hotmail.com wrote:
Thank you for your help Rob.
How can I write a code to go to next iteration of the foreach loop if there
is a Cannot bind a reference error?
Thanks,
Jeffrey
Date: Sun, 2 Oct 2011
Hello,
I am trying to run an insert statement with DBI.
$dbh-do(q{insert into zillow_table values
(?,?,?,?,?,?,?,?)},undef,($homeid,$code,$text,$pid,$street,$city,$state,$zlastupdated));
However, I get Cannot bind a reference error. Why does that occur? $dbh is
part of a foreach
On 01/10/2011 23:16, Jeffrey Joh wrote:
I am trying to run an insert statement with DBI.
$dbh-do(q{insert into zillow_table values
(?,?,?,?,?,?,?,?)},undef,($homeid,$code,$text,$pid,$street,$city,$state,$zlastupdated));
However, I get Cannot bind a reference error. Why does that occur
as a hash reference and I don't understand why.
If I use it in the following line however, it gives the error Can't use an
undefined value as a HASH reference:
my %params = %$fields;
Does anyone have an explanation why in the first example it works fine?
Thanks.
Octavian
--
To unsubscribe, e-mail
/', %$fields );
This script runs with no errors, although the variable $fields is undefined
and it is used as a hash reference and I don't understand why.
If I use it in the following line however, it gives the error Can't use an
undefined value as a HASH reference: my %params = %$fields;
Does
as a hash reference
Hi Octavian,
On Sun, 7 Aug 2011 12:28:27 +0300
Octavian Rasnita orasn...@gmail.com wrote:
Hi,
I made the following test script:
use strict;
use warnings FATAL = 'all';
use LWP::UserAgent;
my $fields;
my $ua = LWP::UserAgent-new;
my $res = $ua-get( 'http
On 31/07/2011 00:55, Rob Dixon wrote:
It may be helpful here to read and understand
perldoc What is the difference between a list and an array
That should be
perldoc -q What is the difference between a list and an array
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For
%coo){
$line.=$key = $val\n;
}
print $line;
On Sat, Jul 30, 2011 at 2:17 AM, timothy adigun 2teezp...@gmail.com wrote:
Hi Rajeev,
with the link you provided, the statement In Perl, you can pass only one
kind of argument to a subroutine: a scalar... a pointer (sort of). was
made
Reference
a reference to it. A reference to anything is a
scalar. If you're a C programmer you can think of a reference as a pointer
(sort of).
is that still true? date on website is 2003...
On that web page it says:
QUOTE
NOTE: Modern Perl versions (5.003 and newer) enable you to do function
prototyping
... a pointer (sort of). was
made
Reference sub-topic. So, it will not be a total truth that one can pass
only one kind of argument to subroutine.
Generally in perl the subroutrine default argument is an array @_, so
that
makes it possible to even pass arrays into subroutine! ** Check Example 1
, the statement In Perl, you can pass only
one
kind of argument to a subroutine: a scalar... a pointer (sort of). was
made
Reference sub-topic. So, it will not be a total truth that one can pass
only one kind of argument to subroutine.
Generally in perl the subroutrine default argument is an array
that by passing a reference to it. A reference to anything is a
scalar. If you're a C programmer you can think of a reference as a pointer
(sort of).
is that still true? date on website is 2003...
I think this thread is getting a little confused. The page you refer to
is very out of date, but in any case
Hello,
from here: http://www.troubleshooters.com/codecorn/littperl/perlsub.htm
i found:
In Perl, you can pass only one kind of argument to a subroutine: a scalar.
To pass any other kind of argument, you need to convert it to a scalar. You
do that by passing a reference to it. A reference
need to convert it to a scalar. You
do that by passing a reference to it. A reference to anything is a
scalar. If you're a C programmer you can think of a reference as a pointer
(sort of).
is that still true? date on website is 2003...
Yes, that is mostly true. You can pass an array
Hi Rajeev,
with the link you provided, the statement In Perl, you can pass only one
kind of argument to a subroutine: a scalar... a pointer (sort of). was made
Reference sub-topic. So, it will not be a total truth that one can pass
only one kind of argument to subroutine.
Generally in perl
you would
$ref outside your function. And modifying the reference shows up everywhere.
That's it.
On Jul 29, 2011 6:58 PM, Rajeev Prasad rp.ne...@yahoo.com wrote:
Hello,
from here: http://www.troubleshooters.com/codecorn/littperl/perlsub.htm
i found:
In Perl, you can pass only one kind
value for:
$ha = $xPath-findnodes('//job');
Error:
Can't call method findnodes on unblessed reference atfile_name line
line_number.
Output from Data::Dumper follows:
$VAR1 = {
'object' = [
{
'objectId' = 'job-21461
:
Can't call method findnodes on unblessed reference at file_name line
line_number.
Output from Data::Dumper follows:
$VAR1 = {
'object' = [
{
'objectId' = 'job-21461',
'job
warnings; use XML::XPath;
Trying to get value for:
$ha = $xPath-findnodes('//job');
Error:
Can't call method findnodes on unblessed reference at file_name line
line_number.
Output from Data::Dumper follows:
$VAR1 = {
'object
Hi Kenneth,
I think the error is clear on what is going wrong: *Error: Can't call
method findnodes on unblessed reference at file_name line line_number.
*
*
*
When you colleague calls: $xPath-findnodes('//job');
Perl tels him that $xPath is not an blessed reference. In human speak
, or the declaration
of $ha.
Error:
Can't call method findnodes on unblessed reference atfile_name line
line_number.
Why are you hiding line_number from us when we have no code? That
also makes sense with the rest of your mail, which shows that whatever
you have dumped is unblessed.
Output
On 18/05/2011 22:21, Kenneth Wolcott wrote:
Should he be using the XML::XPath in OO form and instead of direct
assignment?
There's no file I/O here; perhaps there was an error at the findObjects
call?
Here is a minimized version of the script which illustrates the problem.
use strict;
use
for:
$ha = $xPath-findnodes('//job');
You have shown no code for the derivation of $xPath, or the declaration of
$ha.
Error:
Can't call method findnodes on unblessed reference atfile_name line
line_number.
Why are you hiding line_number from us when we have no code? That
also makes
for:
$ha = $xPath-findnodes('//job');
You have shown no code for the derivation of $xPath, or the declaration of
$ha.
Error:
Can't call method findnodes on unblessed reference atfile_name line
line_number.
Why are you hiding line_number from us when we have no code? That
also makes sense
:-) Guess it is getting late in England as well then :-)
Anyway...
use strict;
use warnings;
use Ec;
use XML::XPath;
use Data::Dumper;
my $ec = Ec-new or die Can not create Ec object $!\n;
my $xPath;
$xPath = $ec-findObjects('job');
print Dumper($xPath);
#my $ha =
On 5/18/11 Wed May 18, 2011 2:25 PM, Rob Dixon rob.di...@gmx.com
scribbled:
That looks fine, except that all you have printed is a hash of data. It
isn't blessed and so it isn't an object.
Please grow up and ask Perl questions. It looks to me as if you are as
silly as each other. I
RC == Rob Coops rco...@gmail.com writes:
RC ps, you might want to besides the rules to always use strict and
RC warnings also implement a rule that before opening of a file one
RC always checks if it exists, and can be opened for the purposes you
RC need it for (read only will not do if
KW == Kenneth Wolcott kennethwolc...@gmail.com writes:
KW my $ec = Ec-new or die Can not create Ec object $!\n;
KW my $xPath;
KW $xPath = $ec-findObjects('job');
KW print Dumper($xPath);
well it is pretty obvious from that. the dumper shows NO blessing so the
call to findObjects didn't
KW == Kenneth Wolcott kennethwolc...@gmail.com writes:
Please grow up and ask Perl questions. It looks to me as if you are as
silly as each other. I certainly wouldn't employ either of you.
I also wonder if you 'Kenneth Wolcott' and your friend are the same
person. Since your
the truth.
Trying to get value for:
$ha = $xPath-findnodes('//job');
You have shown no code for the derivation of $xPath, or the declaration of
$ha.
Error:
Can't call method findnodes on unblessed reference atfile_name line
line_number.
Why are you hidingline_number from us when we have
RD == Rob Dixon rob.di...@gmx.com writes:
RD OK, so what happened here guys?
you went way out of line.
RD Rob, why did you assume to 'use Ec' when it has never been
RD mentioned before on this thread? You also seem to have a lot of
RD insight into the problem before the mess of its
On 18/05/2011 22:37, Kenneth Wolcott wrote:
On Wed, May 18, 2011 at 14:25, Rob Dixonrob.di...@gmx.com wrote:
That looks fine, except that all you have printed is a hash of data. It
isn't blessed and so it isn't an object.
Please grow up and ask Perl questions. It looks to me as if you are as
RD == Rob Dixon rob.di...@gmx.com writes:
RD You are always welcome to any help that we are able to offer here,
RD but please look first at your character issues before you try to
RD write software. We are quite happy to accept innocent failure, but
RD as long as all we have is lies to
Rob, buy a one-way express train ticket to hell.
On Wed, May 18, 2011 at 15:53, Rob Dixon rob.di...@gmx.com wrote:
On 18/05/2011 22:37, Kenneth Wolcott wrote:
On Wed, May 18, 2011 at 14:25, Rob Dixonrob.di...@gmx.com wrote:
That looks fine, except that all you have printed is a hash of
On 18/05/2011 22:58, Jim Gibson wrote:
On 5/18/11 Wed May 18, 2011 2:25 PM, Rob Dixonrob.di...@gmx.com scribbled:
Holy smokes, Rob. That response is totally inappropriate for a beginners
list. I saw nothing wrong with Kenneth's question, except we needed more
information to help him. I think
. We have no idea whether or not the
programs have strict or warnings in force, or whether XML::XPath is
available.
Trying to get value for:
$ha = $xPath-findnodes('//job');
Error:
Can't call method findnodes on unblessed reference atfile_name line
line_number.
So presuming the code line
$ha
RD == Rob Dixon rob.di...@gmx.com writes:
RD If that is the true situation then I am happy to apologize, but even so
RD the question is not a Perl one, as no one can debug what is inaccessible
RD to him.
it doesn't MATTER his situation. he asked a perl question. maybe it
wasn't worded
anything. he may have replied to a different post but he saw the
code that the OP posted. look at this:
---
From: Kenneth Wolcott kennethwolc...@gmail.com
Subject: Re: Can't call method findnodes on unblessed reference; not
using OO Perl
To: Perl Beginners beginners@perl.org
Date: Wed, 18
RD == Rob Dixon rob.di...@gmx.com writes:
RD I usually sign 'HTH' and I always hope I have helped. A few people have
RD disagreed with me tonight; and while that leaves me wondering whether I
RD have been right, I also wonder why comments here are either negative or
RD non-existent.
On 18/05/2011 23:33, Uri Guttman wrote:
KW == Kenneth Wolcottkennethwolc...@gmail.com writes:
Rob Dixon wrote:
Please grow up and ask Perl questions. It looks to me as if you are as
silly as each other. I certainly wouldn't employ either of you.
I also wonder if you 'Kenneth Wolcott'
RD == Rob Dixon rob.di...@gmx.com writes:
RD On 18/05/2011 23:33, Uri Guttman wrote:
KW == Kenneth Wolcottkennethwolc...@gmail.com writes:
Rob Dixon wrote:
Please grow up and ask Perl questions. It looks to me as if you are as
silly as each other. I certainly wouldn't employ
On Wed, May 18, 2011 at 7:55 PM, Rob Dixon rob.di...@gmx.com wrote:
I allow myself to be wrong, but I have no wish to draw others along a
wrong line.
I agree with your sentiment. Lets end this thread now, thank you.
--
Casey West
I have a below program and I am not doing it right.
Currently, only last ip pool is going in since I am putting them w/ key to
values(so only last one shows up when I print).
How can I aggregate and assign them to server_1 so that when I print below
will show up?
server_1
10.1.1.1
10.1.1.2
I am not sure if I am still in mailing list. so cc'ing myself.
On Mon, Feb 28, 2011 at 2:47 PM, steve park rich.j...@gmail.com wrote:
I have a below program and I am not doing it right.
Currently, only last ip pool is going in since I am putting them w/ key to
values(so only last one shows
a variable to its innermost scope?
How can I aggregate and assign them to server_1 so that when I print below
will show up?
server_1
10.1.1.1
10.1.1.2
10.1.1.3
10.1.1.4
10.1.1.5
192.168.1.1
192.168.1.2
Use a hash or an array reference.
More comments on your code, below:
while
On Mon, Feb 28, 2011 at 02:47:30PM -0500, steve park wrote:
Hello,
A couple of things in addition to what Shlomi had already mentioned.
First, you must check your regex. It doesn't really match what you have
mentioned in the __DATA__ section.
Next, doing join('', ...) is just a verbose way of
On 2/28/11 Mon Feb 28, 2011 11:47 AM, steve park rich.j...@gmail.com
scribbled:
I have a below program and I am not doing it right.
Currently, only last ip pool is going in since I am putting them w/ key to
values(so only last one shows up when I print).
How can I aggregate and assign
On 28/02/2011 19:56, steve park wrote:
I have a below program and I am not doing it right. Currently, only
last ip pool is going in since I am putting them w/ key to values(so
only last one shows up when I print).
How can I aggregate and assign them to server_1 so that when I print
below
On Feb 28, 2:47 pm, rich.j...@gmail.com (steve park) wrote:
I have a below program and I am not doing it right.
Currently, only last ip pool is going in since I am putting them w/ key to
values(so only last one shows up when I print).
Hello Steve,
The reason you only get the last value for
At 22:33 + 28/02/2011, Rob Dixon wrote:
The complete program is below.
HTH,
Rob
use strict;
use warnings;
my %HoA;
while ( DATA ) {
my ($swit, $server, $ip_range) = split;
my ($b_real_ip, $b_ip, $e_ip) = $ip_range =~
/(\d+\.\d+\.\d+\.)(\d+)-\1(\d+)/;
for my $byte ($b_ip ..
The program:
--
#use strict;
use warnings;
my $field = shift @ARGV;
my $regex = '(\w+)\s*' x $field;
while (STDIN) {
if (/$regex/) {
print $$field\n; # refers to a match variable
}
}
--
Example Usage:
--
$ echo 'Strange New World!' | ./this_program 3
$
On 11-02-03 08:05 AM, Téssio Fechine wrote:
The program:
--
#use strict;
use warnings;
my $field = shift @ARGV;
my $regex = '(\w+)\s*' x $field;
while (STDIN) {
if (/$regex/) {
print $$field\n;# refers to a match variable
}
}
--
Example Usage:
--
$ echo
TF == Téssio Fechine precheca...@yahoo.com.br writes:
TF The program:
TF --
TF #use strict;
TF use warnings;
TF my $field = shift @ARGV;
TF my $regex = '(\w+)\s*' x $field;
TF while (STDIN) {
TF if (/$regex/) {
TF print $$field\n; # refers to a match variable
print $field\n
~Parag
2011/2/3 Téssio Fechine precheca...@yahoo.com.br
The program:
--
#use strict;
use warnings;
my $field = shift @ARGV;
my $regex = '(\w+)\s*' x $field;
while (STDIN) {
if (/$regex/) {
print $$field\n; # refers to a match variable
On 2/3/11 Thu Feb 3, 2011 5:05 AM, Téssio Fechine
precheca...@yahoo.com.br scribbled:
The program:
--
#use strict;
use warnings;
my $field = shift @ARGV;
my $regex = '(\w+)\s*' x $field;
while (STDIN) {
if (/$regex/) {
print $$field\n; # refers to a match variable
}
}
--
PK == Parag Kalra paragka...@gmail.com writes:
PK print $field\n
what would that supposedly do to help with the question?
and please bottom post. this is a good example. your one line of code
should be BELOW the code it replaces or purports to fix.
thanx,
uri
--
Uri Guttman --
Hello together,
I try to write some arrays into arrays using references.
my ($a, $b, $c, @mytemp, $myref, @my_globael_array)
while($myfile)
{
($a, $b $c ) = getparameter();
@mytemp = ($a, $b, $c);
$myref = \...@mytemp;
push(@my_global_array, $myref);
}
But if I dismantle
Hi Christian.
On Thursday 04 November 2010 11:16:46 Christian Stalp wrote:
Hello together,
I try to write some arrays into arrays using references.
my ($a, $b, $c, @mytemp, $myref, @my_globael_array)
Your code won't compile - you've mis-spelt global and you're missing a
trailing semicolon.
On Thu, Nov 4, 2010 at 4:16 AM, Christian Stalp christian1...@gmx.netwrote:
Hello together,
I try to write some arrays into arrays using references.
my ($a, $b, $c, @mytemp, $myref, @my_globael_array)
while($myfile)
{
($a, $b $c ) = getparameter();
@mytemp = ($a, $b, $c);
$myref =
On Nov 4, 2:16 am, christian1...@gmx.net (Christian Stalp) wrote:
Hello together,
I try to write some arrays into arrays using references.
my ($a, $b, $c, @mytemp, $myref, @my_globael_array)
while($myfile)
{
($a, $b $c ) = getparameter();
�...@mytemp = ($a, $b, $c);
$myref =
On 2010-11-04 10:16, Christian Stalp wrote:
Hello together,
I try to write some arrays into arrays using references.
my ($a, $b, $c, @mytemp, $myref, @my_globael_array)
while($myfile)
{
($a, $b $c ) = getparameter();
@mytemp = ($a, $b, $c);
$myref = \...@mytemp;
the final loop values.
One solution: declare @mytemp within -- rather than outside --
the loop. This allocates new memory for @mytemp during
each loop iteration to prevent overwriting.
while($myfile)
{
($a, $b $c ) = getparameter();
my @mytemp = ($a, $b,
Hi,
I have an array with anonymous hash references like the following:
$foo = [
{
name = value,
id = value,
},
{
name = value,
id = value,
}
];
Iterating through the hash references works with:
foreach $item (@$foo) {
do something with $item-name;
}
What
于 2010-10-31 21:43, Thorsten Scherf 写道:
Hi,
I have an array with anonymous hash references like the following:
$foo = [ {
name = value,
id = value,
},
{
name = value,
id = value,
}
];
Iterating through the hash references works with:
foreach $item (@$foo) {
do something with $item-name;
}
JP == Jeff Pang jeff_p...@sina.com writes:
JP print check_for_exists('name','foo');
JP sub check_for_exists {
JPmy $key = shift;
JPmy $value = shift;
JP for my $item (@$foo) {
JP if ($item-{$key} eq $value ) {
JPreturn 1;
JP }
JP }
1 - 100 of 658 matches
Mail list logo