Re: accessing hash value with ->

2005-01-14 Thread Robert Boone
ame as if I did. my $open = \&dosomething; $open->($THE_COMMAND); You can get a better understanding of references from here: http://www.perlmonks.org/index.pl?node_id=137108 Hope this helps, Robert Boone On Fri, 2005-01-14 at 12:10 -0500, radhika sambamurti wrote: > Hi, >

Re: "or die" question

2005-01-25 Thread Robert Boone
The "or " can call a subroutine. open (TEST, ">/tmp/test") or myDie(); sub myDie { syslog("LOG_ALERT","Could not open test file"); die "Could not open test file\n"; } On Tue, 2005-01-25 at 08:17 -0600, Rod Jenkins wrote: > After a failed open, I want to run two statements for

Re: Eval Questions with blocks

2007-02-19 Thread Robert Boone
The general form for block eval is: #!/usr/bin/perl use strict; use warnings; eval { die 'There was an error!!!' . "\n"; }; if ($@) { print $@; } print 'On the other side.' . "\n"; Robert On Feb 19, 2007, at 4:13 PM, Gallagher, Tim F ((NE)) wrote: I am working my butt off trying

Re: What's the Perl equivalent of this PHP contruct?

2007-03-01 Thread Robert Boone
On Mar 1, 2007, at 10:51 AM, Traeder, Philipp wrote: On Thursday 01 March 2007 06:52, Randall wrote: I've translated the following PHP snippet: $data = array(); $num = 0; $data[$num]['title'] = 'Name'; $data[$num]['data'] = 'Randall'; $num++; As this Perl: my @data; my $num = 0; $data[$nu

Re: Treating a split() as an array

2007-03-02 Thread Robert Boone
I think this is all you do: $piid = (split(/\t/, $row))[0]; On Mar 2, 2007, at 3:07 PM, Shawn Milo wrote: Considering the following: @temp = split(/\t/, $row); $piid = $temp[0]; Is it possible to cut this down to one line, similar to the following Python code? piid = row.split('\t')[0] T

Re: Perl Frameworks?

2007-03-07 Thread Robert Boone
There several more. Off the top of my head I can think of: Maypole Jifty CGI::Application CGI::Prototype This is by no means a complete list. On Mar 7, 2007, at 10:48 AM, Tom Smith wrote: I'm curious... With all the buzz about MVC frameworks now, what does Perl have for this? The only two t

Re: New to OO Perl

2007-05-02 Thread Robert Boone
You may want to seperate your initialization from instantiation. sub new { my ( $class, $data ) = @_; my $self = bless {}, $class; $self->init(); return $self; } sub init { my ($self) = @_; $self->{image_magick_object} = Image::M