Re: Saving param after new recall of a cgi script

2009-11-28 Thread Marek
On 27 Nov., 10:42, rrogg...@uni-osnabrueck.de (Robert Roggenbuck) wrote: You should store the values from step 2 at step 3 in hidden parameters (input type=hidden ...). The You can access them via CGI in step 4. An alternative would be storing the whole CGI-object in a file using Data::Dumper

RE: Loading results (via ajax) from a CGI

2009-11-28 Thread Dermot Paikkos
This is of course a javascript/ajax question to a perl list -Original Message- From: bu...@alejandro.ceballos.info [mailto:bu...@alejandro.ceballos.info] Sent: 27 November 2009 13:59 To: beginners-cgi@perl.org Subject: Loading results (via ajax) from a CGI Any idea where is

problems with 'require'

2009-11-28 Thread Paweł Prędki
Hey, I've been using simple CGI scripts to make some things on my website require less human touch and some of them require mysql database connection. I've started with only one such scripts but now there are more so I've decided to move the connection data (table name, database name,

Re: why can't I collapse reference variable?

2009-11-28 Thread C.DeRykus
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. What

reference to anonymous array, references last element instead??

2009-11-28 Thread Mark_Galeck
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/

Re: reference to anonymous array, references last element instead??

2009-11-28 Thread John W. Krahn
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: $foobar = \bar;

Re: reference to anonymous array, references last element instead??

2009-11-28 Thread John Refior
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 jwkr...@shaw.ca wrote: Mark_Galeck wrote: Why does $foobar = \(foo, bar);

Re: reference to anonymous array, references last element instead??

2009-11-28 Thread John Refior
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 jref...@gmail.com wrote: Just replying to add that you can use square brackets for an array literal: $foobar

reference to anonymous array, references last element instead??

2009-11-28 Thread Mark_Galeck
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/

Re: Separating DB operations out of program code

2009-11-28 Thread Dermot
2009/11/27 Steve Bertrand st...@ibctech.ca: Dermot wrote: 2009/11/26 Scott Pham scott.p...@gmail.com: 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

Re: remove directory from @INC

2009-11-28 Thread Huub van Niekerk
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

Autovivification of hash from an array

2009-11-28 Thread Jeremiah Foster
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

Re: Autovivification of hash from an array

2009-11-28 Thread Jeremiah Foster
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 of

Re: Autovivification of hash from an array

2009-11-28 Thread Shawn H Corey
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 need to

Re: Autovivification of hash from an array

2009-11-28 Thread Jeremiah Foster
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{$package} =

Re: Autovivification of hash from an array

2009-11-28 Thread John W. Krahn
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

Re: Autovivification of hash from an array

2009-11-28 Thread Uri Guttman
JF == Jeremiah Foster jerem...@jeremiahfoster.com 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

Re: Assignment Operator

2009-11-28 Thread Jenda Krynicky
From: Marco Pacini i...@marcopacini.org 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

PRINT LAST ENTRY IN A FILE

2009-11-28 Thread raphael()
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 should

Re: PRINT LAST ENTRY IN A FILE

2009-11-28 Thread Dermot
2009/11/28 raphael() raphael.j...@gmail.com: 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

Re: PRINT LAST ENTRY IN A FILE

2009-11-28 Thread Dermot
2009/11/28 raphael() raphael.j...@gmail.com: 2009/11/28 raphael() raphael.j...@gmail.com: 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

Re: remove directory from @INC

2009-11-28 Thread Owen
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

Re: remove directory from @INC

2009-11-28 Thread Huub van Niekerk
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:

Re: Separating DB operations out of program code

2009-11-28 Thread Shlomi Fish
Hi Dermot! On Saturday 28 Nov 2009 13:53:45 Dermot wrote: 2009/11/27 Steve Bertrand st...@ibctech.ca: Dermot wrote: 2009/11/26 Scott Pham scott.p...@gmail.com: Have you looked at DBIx::Class? I'd 2nd that. DBIx is the way forward. You should be looking to stop writing SQL statements

Insecure $ENV{PATH} message

2009-11-28 Thread Huub van Niekerk
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 the