Hi,
I am doing some homework from the book Learning Perl chapter 4 excercise 1,
Looking at the script below, I wonder why line 6 (print "Enter some numbers on
separate line: ";) is not printed immediately after the previous print.
Thanks
use strict;
use warnings;
my @fred = qw/1 3 5 7 9/;
my $fr
On Apr 5, 7:20 am, [EMAIL PROTECTED] (John W. Krahn) wrote:
>
> WARNINGS
> If you run your program with the "-w" switch, or if you use the
> "warnings" pragma, File::Find will report warnings for several
> weird situations. You can disable these warnings by putting the
>
[EMAIL PROTECTED] schreef:
> use strict;
> use warnings;
>
> open (MYDATAS , " my @datas = ;
> close MYDATAS;
>
> foreach (@datas){
> s/^\s*$//;
> }
>
> open (WRITEDATAS, ">testing.txt") || die $!;
> print WRITEDATAS @datas;
> close WRITEDATAS;
That looks a lot like Perl 4. Study this:
#!/usr
On Sun, Apr 6, 2008 at 5:36 AM, <[EMAIL PROTECTED]> wrote:
snip
> my $user_total = &total();
snip
First off, don't call functions with &*. The problem here is that you
are evaluating in list context. That means it will read from
STDIN until it is closed. To close a STDIN on UNIX use control-
[EMAIL PROTECTED] wrote:
I am doing some homework from the book Learning Perl chapter 4
excercise 1,
Looking at the script below, I wonder why line 6 (print "Enter some
numbers on separate line: ";) is not printed immediately after the
previous print.
I don't understand what you mean. However
Hello everyone, I need to serialize an perl object to STRING TEXT, not scalar
or file. The Storable module allow serialization to file and scalar variable,
but this is not possible for passing between the perl and prolog program,
that's why I need it to be string. I tried out the FreezeThaw modu
On Sun, Apr 6, 2008 at 1:52 PM, anthony brooke <[EMAIL PROTECTED]> wrote:
> Hello everyone, I need to serialize an perl object to STRING TEXT,
> not scalar or file. The Storable module allow serialization to file and
> scalar variable, but this is not possible for passing between the perl
> and pro
Thanks for the reply, I always thought that Dumper is used for debugging
purposes, I will look at it deeper. Btw, what you mean by cyclic data ?
- Original Message
From: Chas. Owens <[EMAIL PROTECTED]>
To: anthony brooke <[EMAIL PROTECTED]>
Cc: beginner perl mailling list
Sent: Monday
protoplasm wrote:
On Apr 5, 7:20 am, [EMAIL PROTECTED] (John W. Krahn) wrote:
WARNINGS
If you run your program with the "-w" switch, or if you use the
"warnings" pragma, File::Find will report warnings for several
weird situations. You can disable these warnings by puttin
On Sun, Apr 6, 2008 at 2:33 PM, anthony brooke <[EMAIL PROTECTED]> wrote:
> Thanks for the reply, I always thought that Dumper is used for debugging
> purposes, I will look at it deeper. Btw, what you mean by cyclic data ?
snip
Data::Dumper is often used to display the contents of a data structur
anthony brooke schreef:
> I need to serialize an perl object to STRING TEXT,
> not scalar
Printing (the value of) a scalar, gives you a string.
See `perldoc -f sprintf`.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [E
On Sun, Apr 6, 2008 at 6:17 PM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
snip
> > I need to serialize an perl object to STRING TEXT,
> > not scalar
>
> Printing (the value of) a scalar, gives you a string.
> See `perldoc -f sprintf`.
snip
Unfortunately the freeze subroutine from Storable outputs a b
Many programming languages (including Perl, Ruby, and PHP) support hashes:
$color['apple'] = 'red';
$color['ruby'] = 'red';
$type['apple'] = 'fruit';
$type['ruby'] = 'gem';
This quickly lets me find the color or type of a given item.
In this sense, color() and type() are like mathematical funct
On Sun, Apr 6, 2008 at 4:52 PM, Kelly Jones <[EMAIL PROTECTED]> wrote:
> Many programming languages (including Perl, Ruby, and PHP) support hashes:
>
> $color['apple'] = 'red';
> $color['ruby'] = 'red';
>
> $type['apple'] = 'fruit';
> $type['ruby'] = 'gem';
>
> This quickly lets me find the co
Thomas Bätzler wrote:
Richard Lee <[EMAIL PROTECTED]> asked:
What is the best way to indicate past hour from current time
without using a module?
[...]
#!/usr/bin/perl -w
use strict;
printf "%d:%02d to %d:%02d\n", (localtime time - 3600 )[2,1], (localtime
time)[2,1];
__END__
I am trying to open a big file and go through line by line while
limiting the resource on the system.
What is the best way to do it?
Does below read the entire file and store them in memory(not good if
that's the case)..
open(SOURCE, "/tmp/file") || die "not there: $!\n";
while () {
## do som
Richard Lee wrote:
I am trying to open a big file and go through line by line while
limiting the resource on the system.
What is the best way to do it?
Does below read the entire file and store them in memory(not good if
that's the case)..
open(SOURCE, "/tmp/file") || die "not there: $!\n";
On Sun, 2008-04-06 at 16:52 -0700, Kelly Jones wrote:
> Many programming languages (including Perl, Ruby, and PHP) support hashes:
>
> $color['apple'] = 'red';
> $color['ruby'] = 'red';
>
> $type['apple'] = 'fruit';
> $type['ruby'] = 'gem';
>
> This quickly lets me find the color or type of a gi
On Sun, Apr 6, 2008 at 10:36 PM, Richard Lee <[EMAIL PROTECTED]> wrote:
> I am trying to open a big file and go through line by line while limiting
> the resource on the system.
> What is the best way to do it?
>
> Does below read the entire file and store them in memory(not good if that's
> the
On Sun, 2008-04-06 at 22:36 -0400, Richard Lee wrote:
> I am trying to open a big file and go through line by line while
> limiting the resource on the system.
> What is the best way to do it?
>
> Does below read the entire file and store them in memory(not good if
> that's the case)..
>
> open
I just read FAQ on finding out yesterday's time.
I see that one of the easy way to find out is
my $date = scalar localtime( ( time() - ( 24 * 60 * 60 ) ) );
print "$date\n";
and it works fine for me
I also see lot of modules that will make life easier for beginners.. but
since I was learning
- Original Message
From: Gunnar Hjalmarsson <[EMAIL PROTECTED]>
To: beginners@perl.org
Sent: Saturday, April 5, 2008 11:22:41 PM
Subject: Re: String To Hash Conversion
Prabu Ayyappan wrote:
> I want to convert a string into a Hash data structure
>
> For Example
>
> String:
> "[['aaa
22 matches
Mail list logo