Suppose I have a multidimensional array of the form:
@array[names][values]
For example, I have a list of database field names and the value
associated with each one.
If this was a single dimensional array called @list, I could create an
output line in CSV format by using the 'join' command like
Hi All,
Can we handle exceptions in PERL programs?
For example - Here if it fails to copy then can I handle the exception
and perform the next steps in my script? I tried removing "die" but then
it does not complain and I wont be able to come to know if that is
copied or not. (Is there anyt
The following sub uses "fetchall_arrayref" in the DBI module to put the
results of an SQL command into an array, where each element of the array
is a hash of that records name/value pairs. The documentation says to
pass it a reference to a hash. My interpretation of that requirement is
below. Di
On Fri, 2009-02-27 at 08:41 -0500, Sarsamkar, Paryushan wrote:
> copy ("C:\\build.xml","D:\\build.xml") or die "Cannot copy : $!";
simplest (?) solution:
copy ("C:\\build.xml","D:\\build.xml") or print "Cannot copy : $!";
You can also have it do more than one thing:
copy ("C:\\build.xml","D:\\bui
On Fri, 2009-02-27 at 08:49 -0500, David Shere wrote:
> You can also have it do more than one thing:
> copy ("C:\\build.xml","D:\\build.xml") or ( print "Cannot copy : $!" and
> somethingElse() );
Or you can have more fun:
unless (copy ("C:\\build.xml","D:\\build.xml")) {
print "Cannot copy : $
Thanks...
My bad... I did not realize to use print instead of just "die"ing :)
Thanks,
Paryushan
-Original Message-
From: David Shere [mailto:dsh...@steelerubber.com]
Sent: Friday, February 27, 2009 7:31 PM
To: Sarsamkar, Paryushan
Cc: beginners@perl.org
Subject: Re: Exception Handling
Hi All,
I would like to accept some user inputs (using ), but it might be
easier for a user if I can provide the default value, so that they just
have to press ENTER.
How can I do that? I've played around with but I cannot make it
work exactly as I'd like.
E.g.
Do you want to do th
Bill Harpley wrote:
Suppose I have a multidimensional array of the form:
@array[names][values]
For example, I have a list of database field names and the value
associated with each one.
Is this what you mean:
my @record = (
[ col1 => 'val1' ],
[ col2 => 'val2' ],
);
Sarsamkar, Paryushan wrote:
I would like to accept some user inputs (using ), but it might be
easier for a user if I can provide the default value, so that they just
have to press ENTER.
How can I do that? I've played around with but I cannot make it
work exactly as I'd like.
E.g.
Do you want
On Fri, Feb 27, 2009 at 10:03, Sarsamkar, Paryushan wrote:
snip
> I would like to accept some user inputs (using ), but it might be
> easier for a user if I can provide the default value, so that they just
> have to press ENTER.
snip
> Do you want to do the normal thing? [yes] :
>
> Do you want to
Hi people!!
I´m using Perl for the first time in my Mac OS X...
How can I check installed modules ???
I am running a Mac OS X Leopard 10.5.6 with Perl version v5.8.8 built for
darwin-thread-multi-2level...
Thanks
On Fri, Feb 27, 2009 at 11:07, Gunnar Hjalmarsson wrote:
> Sarsamkar, Paryushan wrote:
>>
>> I would like to accept some user inputs (using ), but it might be
>> easier for a user if I can provide the default value, so that they just
>> have to press ENTER.
>>
>> How can I do that? I've played aro
On Fri, Feb 27, 2009 at 11:16, wrote:
> Hi people!!
>
> I´m using Perl for the first time in my Mac OS X...
>
>
> How can I check installed modules ???
>
>
> I am running a Mac OS X Leopard 10.5.6 with Perl version v5.8.8 built for
> darwin-thread-multi-2level...
>
>
> Thanks
>
Please do not
Jim Gibson wrote:
On 2/26/09 Thu Feb 26, 2009 3:53 PM, "John W. Krahn"
scribbled:
I get "Use of uninitialized value in numeric gt (>) at ..." for that, since
@max is undefined the first time through the loop. Here is a version using
each that doesn't produce that error. It uses the fact th
On Fri, Feb 27, 2009 at 08:43, David Shere wrote:
> The following sub uses "fetchall_arrayref" in the DBI module to put the
> results of an SQL command into an array, where each element of the array
> is a hash of that records name/value pairs. The documentation says to
> pass it a reference to a
Hi there, I would like to know how can I install Perl DBD, DBI::mysql
Modules
I have an Intel Mac OS X (10.5.6) Leopard with Perl v5.8.8 built for
darwin-thread-multi-2level
Subject:Re: Exception Handling in perl
From: David Shere
To: "Sarsamkar, Paryushan"
Copies to: beginners@perl.org
Date sent: Fri, 27 Feb 2009 09:00:41 -0500
> On Fri, 2009-02-27 at 08:49 -0500, David Shere wrote:
> >
From: "Bill Harpley"
> Suppose I have a multidimensional array of the form:
>
> @array[names][values]
>
> For example, I have a list of database field names and the value
> associated with each one.
>
> If this was a single dimensional array called @list, I could create an
> output line in CSV
hi,
You maybe need investigate the correct way to do it in Mac OS X 9
maybe macports, I dont' have idea.
In BSD (pkgsrc or ports ) are the best way to do it task.
Try with
$ perl -MCPAN -e shell
Regards
On Fri, Feb 27, 2009 at 11:15 AM, wrote:
> Hi there, I would like to know how can I inst
On 2/27/09 Fri Feb 27, 2009 8:33 AM, "Rick"
scribbled:
> Jim Gibson wrote:
>> On 2/26/09 Thu Feb 26, 2009 3:53 PM, "John W. Krahn"
>> scribbled:
>>
>> I get "Use of uninitialized value in numeric gt (>) at ..." for that, since
>> @max is undefined the first time through the loop. Here is
On 2/27/09 Fri Feb 27, 2009 5:21 AM, "Bill Harpley"
scribbled:
> Suppose I have a multidimensional array of the form:
>
> @array[names][values]
There is no such construct in Perl. An array is a one-dimensional list of
scalar values, indexed by integers. You can emulate multi-dimensional array
Jenda Krynicky wrote:
From: "Bill Harpley"
Suppose I have a multidimensional array of the form:
@array[names][values]
For example, I have a list of database field names and the value
associated with each one.
If this was a single dimensional array called @list, I could create an
output line
Chas. Owens wrote:
On Fri, Feb 27, 2009 at 08:43, David Shere wrote:
The following sub uses "fetchall_arrayref" in the DBI module to put the
results of an SQL command into an array, where each element of the array
is a hash of that records name/value pairs. The documentation says to
pass it a
Chas. Owens wrote:
On Fri, Feb 27, 2009 at 11:07, Gunnar Hjalmarsson wrote:
Sarsamkar, Paryushan wrote:
I would like to accept some user inputs (using ), but it might be
easier for a user if I can provide the default value, so that they just
have to press ENTER.
How can I do that? I've played
On 2/27/09 Fri Feb 27, 2009 2:05 PM, "Gunnar Hjalmarsson"
scribbled:
> Which takes us to the obvious step of validating the user input.
>
> my $normal;
> while (1) {
> print 'Do you want to do the normal thing? [yes] : ';
> chomp( $normal = );
> $normal =
Gunnar Hjalmarsson wrote:
> Chas. Owens wrote:
>> On Fri, Feb 27, 2009 at 11:07, Gunnar Hjalmarsson wrote:
>>> Sarsamkar, Paryushan wrote:
I would like to accept some user inputs (using ), but it might be
easier for a user if I can provide the default value, so that they just
have t
- Original Message -
From: "John W. Krahn"
To: "Perl Beginners"
Sent: Thursday, February 26, 2009 10:54 PM
Subject: Re: regarding regular expression
Irfan Sayed wrote:
Hi All,
Hello,
I have a string like this "pqp-un_1.0G_2009-02-23_17-38-09_5678903.txt
" now what i need is only
Jim Gibson wrote:
NO it is not. The way to diagnosis this type of problem is to look at the
contents of your variables, either by stepping through your program with a
debugger or by adding print statements to your program. If you do that, you
will find that the @next array is not assigned the key
Jim Gibson wrote:
On 2/27/09 Fri Feb 27, 2009 8:33 AM, "Rick"
scribbled:
Jim Gibson wrote:
On 2/26/09 Thu Feb 26, 2009 3:53 PM, "John W. Krahn"
scribbled:
I get "Use of uninitialized value in numeric gt (>) at ..." for that, since
@max is undefined the first time through the
29 matches
Mail list logo