On Nov 24, 11:14 am, mark_galeck_spam_mag...@yahoo.com (Mark_Galeck)
wrote:
> If I can do this:
>
> $ref = \...@foobar;
> print @$ref;
>
> then why can't I do this:
>
> print @\...@foobar;
Because you're asking the parser to do too much. It needs
to quickly identify the reference without ambiguity
Why does
$foobar = \("foo", "bar");
print $$foobar;
print "bar" ??
Thank you for any insight. Mark
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Mark_Galeck wrote:
Why does
$foobar = \("foo", "bar");
print $$foobar;
print "bar" ??
Thank you for any insight. Mark
Because \("foo", "bar") is really (\"foo", \"bar") and the comma
operator in scalar context will return the last item listed so:
$foobar = \("foo", "bar");
Is just:
$
Just replying to add that you can use square brackets for an array literal:
$foobar = ['foo', 'bar'];
See http://perldoc.perl.org/perlref.html#Making-References .
John
On Sat, Nov 28, 2009 at 5:53 AM, John W. Krahn wrote:
> Mark_Galeck wrote:
>
>> Why does
>>
>> $foobar = \("foo", "bar");
>>
Woops - meant to write "anonymous array" literal. $foobar will be a
reference to the anonymous array that contains ('foo', 'bar'). - John
On Sat, Nov 28, 2009 at 6:03 AM, John Refior wrote:
> Just replying to add that you can use square brackets for an array literal:
>
>
> $foobar = ['foo', 'b
Why does
$foobar = \("foo", "bar");
print $$foobar;
print "bar" ??
Thank you for any insight. Mark
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
2009/11/27 Steve Bertrand :
> Dermot wrote:
>> 2009/11/26 Scott Pham :
>>> Have you looked at DBIx::Class?
>>>
>>
>> I'd 2nd that. DBIx is the way forward. You should be looking to stop
>> writing SQL statements and moving towards ORM. Try the example at
>> http://search.cpan.org/~frew/DBIx-Class-0
Thank you for your answer.
I changed the beginning of my code to this:
#!/usr/bin/perl
no lib "/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/";
use lib "/usr/lib/perl5/5.10.0/i386-linux-thread-multi/";
use DBI;
use strict;
use warnings;
use PostScript::Simple;
No errors are given
Hi there!
This may or may not be a beginners question. If not, please let me know
where I ought to post. :-)
I have a data structure, a simple array. It is made up of sections of
files I have slurped;
sub _build_packages {
use Perl6::Slurp;
my @p
Edit: Added missing 'push' to code example.
On Nov 28, 2009, at 14:13, Jeremiah Foster wrote:
> Hi there!
>
> This may or may not be a beginners question. If not, please let me know
> where I ought to post. :-)
>
> I have a data structure, a simple array. It is made up of sections
Jeremiah Foster wrote:
>> my %versions;
>>map {
>> my $package = $_;
>> # autovivfy a hash with versions of packages
>> $versions{$package} = [ ] unless exists $versions{$package};
> push @{ $versions{$package} = $version
>} @packages
You don't
On Nov 28, 2009, at 15:25, Shawn H Corey wrote:
> Jeremiah Foster wrote:
>>> my %versions;
>>> map {
>>> my $package = $_;
>>> # autovivfy a hash with versions of packages
>>> $versions{$package} = [ ] unless exists $versions{$package};
>> push @{ $versions{$
Jeremiah Foster wrote:
Hi there!
Hello,
This may or may not be a beginners question. If not, please let me
know where I ought to post. :-)
I have a data structure, a simple array. It is made up of sections of
files I have slurped;
sub _build_packages {
use Perl6::Slurp;
Do you reall
> "JF" == Jeremiah Foster writes:
JF> # autovivfy a hash with versions of packages
JF> $versions{$package} = [ ] unless exists $versions{$package};
that is MANUALLY vivifying an array. if you just pushed to the slot with
a dereference, that would be autovivifying. only p
From: Marco Pacini
Subject:Assignment Operator
Date sent: Thu, 26 Nov 2009 12:31:54 +0100
To: beginners@perl.org
> Hi All,
>
> I'm studying Perl since one week on "Learning Perl" written by L. Wall
> and in the paragraph "Assignm
Hi,
I want to print the last entry by record "" in this file "records.txt"
The file is read in a subroutine and prints last line by the number in this
example.
# records.txt
25.11.2009 NAME_0
15.12.2006 NAME_3
20.10.2007 NAME_1
01.01.2008 NAME_3<-- This whole line sho
2009/11/28 raphael() :
> Hi,
Hi,
> # records.txt
> 25.11.2009 NAME_0
> 15.12.2006 NAME_3
> 20.10.2007 NAME_1
> 01.01.2008 NAME_3 <-- This whole line should be printed.
> 10.10.2008 NAME_4
>
> Using while in a while loop matching ( m// ) I get all the entries
> havin
2009/11/28 raphael() :
>> 2009/11/28 raphael() :
>> > Hi,
>> Hi,
>>
>> > # records.txt
>> > 25.11.2009 NAME_0
>> > 15.12.2006 NAME_3
>> > 20.10.2007 NAME_1
>> > 01.01.2008 NAME_3 <-- This whole line should be printed.
>> > 10.10.2008 NAME_4
>> >
>> > Using while in a whi
> Thank you for your answer.
>
> I changed the beginning of my code to this:
>
> #!/usr/bin/perl
> no lib
> "/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/";
> use lib "/usr/lib/perl5/5.10.0/i386-linux-thread-multi/";
> use DBI;
> use strict;
> use warnings;
> use PostScript::Simpl
>
> Well I have no idea if it will solve your problem, but try one of these;
>
> a. make a symbolic link between libssl.so.8 and libssl.so.10 b. or
> simply copy libssl.so.10 as lbssl.so.8
>
Thank you. Didn't think of "ln -s". That works now.
--
To unsubscribe, e-mail: beginners-unsubscr...@
Hi Dermot!
On Saturday 28 Nov 2009 13:53:45 Dermot wrote:
> 2009/11/27 Steve Bertrand :
> > Dermot wrote:
> >> 2009/11/26 Scott Pham :
> >>> Have you looked at DBIx::Class?
> >>
> >> I'd 2nd that. DBIx is the way forward. You should be looking to stop
> >> writing SQL statements and moving towards
Hi,
I started getting this error after upgrading from Fedora 11 to 12. The
line of code hasn't been changed:
open my $LPR, '|-', qw/lpr -PDeskJet940C/ or die "can't fork lpr: $!";
The error is: "Insecure $ENV{PATH} while running with -T switch at"
pointing at the line above. From articles on
22 matches
Mail list logo