Hi Peter,
Your codes look great and it works perfectly with only some minor problems
which might due to the XML file itself (I think). However, compared your
codes with mine, there are something I'd like to ask you if you don't mind.
1) what's the main difference on memory load bewteen setting
Your codes look great and it works perfectly with only some minor problems
which might due to the XML file itself (I think). However, compared your
codes with mine, there are something I'd like to ask you if you don't mind.
Not that much :)
1) what's the main difference on memory load
Hello Perl Experts,
I am facing a problem day-in and day-out with my perl code. There are
a couple of subroutines in it. Below I am writing the stub-form of my
perl code.
===
#!/usr/local/bin/perl
#Some comments
...
use strict;
use
Since upgrading to FC4-test3 which has version 1.4.1 of DBD-Pg
installed, placeholders no longer work for example the following code
$cat='1';
#$cat=param('Category');
print $cat;
print start_multipart_form (POST,'con_upd.pl');
$row=$dbh-prepare(SELECT type_code FROM lk_sort_of_contact WHERE
Manish Sapariya [MS], on Tuesday, May 17, 2005 at 17:38 (+0530) has on
mind:
MS echo 1: 192.168.0.180:32866 - 192.168.0.183:143 (a2b)
MS 17 14 (complete) | perl -lane 'print$_;if($_ =~
MS /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5}) -
MS (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})/)
Christopher L Hood [EMAIL PROTECTED] wrote ...
Why doesn't this work to check the STDIN until it is one of the numbers
1 2 3 4 5 ?? I have tried multiple variations of this with different
brackets ie. [ ] , and ( ) .
Chris, this doesn't work because you didn't write valid code. ;-)
I think
this is my script
#!/usr/bin/perl -w
use lib /my/perl_directory/lib/perl5/site_perl/5.8.3/;
use IO::Socket::INET6;
$host=150.187.25.206;
my $dat1;
my @arreglo;
my @arreglo2;
my $dat2;
my $dat3;
my $dato;
my $count;
my $volt1;
$remote = IO::Socket::INET6-new( Proto = tcp,
sub readDefectData {
my $defectDataFH=new FileHandle;
open ($defectDataFH,$_[0]) or die Error: Cannot load defectivity
data, $_[0]\n;
print Loading defect data ... ;
my %short;
while ($_=$defectDataFH-getline) {
chomp;
Manuel Sanguino wrote:
this is my script
#!/usr/bin/perl -w
use lib /my/perl_directory/lib/perl5/site_perl/5.8.3/;
use IO::Socket::INET6;
$host=150.187.25.206;
my $dat1;
my @arreglo;
my @arreglo2;
my $dat2;
my $dat3;
my $dato;
my $count;
my $volt1;
$remote =
Is there a way to determine how much a certain data structure costs in terms
of memory? In other words is there some built in command or module that
takes a reference to a nested data structure and gives a ball park idea of
how much memory this structure takes.
Thanks
Peter
--
To
Am Dienstag, 17. Mai 2005 19.45 schrieb Peter Rabbitson:
Is there a way to determine how much a certain data structure costs in
terms of memory? In other words is there some built in command or module
that takes a reference to a nested data structure and gives a ball park
idea of how much
Is there a way to determine how much a certain data structure costs in terms
of memory? In other words is there some built in command or module that
takes a reference to a nested data structure and gives a ball park idea of
how much memory this structure takes.
Hi,
I have a simple code but I just cannot get the correct result. Can anyone
take a look at the code for me? Many thanks.
print \nOutput: AS -- Subnets\n;
foreach $key (sort numerically (keys %subnets)) {
print key = $key, \n;
@subnet = split(/:/, $subnets{$key});
for ($i = 0; $i =
Zhenhai Duan wrote:
Hi,
I have a simple code but I just cannot get the correct result. Can
anyone take a look at the code for me? Many thanks.
print \nOutput: AS -- Subnets\n;
foreach $key (sort numerically (keys %subnets)) {
print key = $key, \n;
@subnet = split(/:/,
Hello,
In the following I was thinking it would just print out: Hello
#!/usr/bin/perl -w
$S = Hello, Perl!;
($R) = grep {/\w+/} $S;
print $R\n;
I am trying for some sort of inline filtering so I can do the following:
#!/usr/bin/perl -w
use CGI qw/:standard/;
use strict;
my $page = grep
David Gilden wrote:
Hello,
In the following I was thinking it would just print out: Hello
#!/usr/bin/perl -w
$S = Hello, Perl!;
($R) = grep {/\w+/} $S;
print $R\n;
I am trying for some sort of inline filtering so I can do the following:
#!/usr/bin/perl -w
use CGI qw/:standard/;
use strict;
my
Wagner,
Many thanks for the help.
It turned out that the problem is related to the input file, where each
line ends with both a \n and \r. It seems that chomp() has removed \n, but
\r is still there, so that the key and value etc are not integers.
I also noticed that if I read the file, and
I'm trying to use the example on page 461 of Programming Perl. I've modified
the code slightly and the problem is that the dequeue function seems to have
no effect. I never see the print statement execute that indicates it has
removed something from the queue. I do see the New Thread starting
All,
My goal is to get element 9 of stat which is mtime. I am getting this with
ease, but my end goal is to convert this number back into a readable format
giving me how old the file is.
So here is a rough draft formula : (time in seconds - last MTime ) =
seconds old.
Convert seconds old
David Gilden wrote:
Hello,
Hello,
In the following I was thinking it would just print out: Hello
#!/usr/bin/perl -w
$S = Hello, Perl!;
($R) = grep {/\w+/} $S;
grep() filters lists so if an element of the list on the right contains \w+ it
will be passed through to the left but other elements will
Hi,
I'm trying to remove multiple spaces from a string but can't seemed to
get it to do what I want without creating a long subroutine.
I have a text file that contains various pieces of data that I want to
import. However, there are gaps in between of various sizes. I want to
cut them down
Dale wrote:
Hi,
I'm trying to remove multiple spaces from a string but can't seemed to
get it to do what I want without creating a long subroutine.
I have a text file that contains various pieces of data that I want to
import. However, there are gaps in between of various sizes. I want
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s// /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s// /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
is the same as:
$str =~ s/\s{2,10}/ /;
Read perldoc perlre, especially the part about
Could somebody point me to a resource of how to upload a file using LWP via
a data string or a filehandle such a string (I don't want to create a temp
file on disk just to delete it after the upload).
Thank you
Peter
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
Dale wrote:
Hi,
Hello,
I'm trying to remove multiple spaces from a string but can't seemed to
get it to do what I want without creating a long subroutine.
I have a text file that contains various pieces of data that I want to
import. However, there are gaps in between of various sizes. I want
Peter Rabbitson wrote:
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s// /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s// /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
is the same as:
$str =~ s/\s{2,10}/ /;
Not quite. The \s character class
Hi David Wagner, you wrote:
$str =~ s/\s+/ /g;
This will take one or more white space and replace all found with one
space. If you only want a space then s/ +/ /g would be what you want.
white space would cover tabs and spaces.
Thanks for the reply. I thought that using + would look for
Hi Peter Rabbitson, you wrote:
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s// /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
$str =~ s// /i;
$str =~ s/ / /i;
$str =~ s/ / /i;
is the same as:
$str =~ s/\s{2,10}/ /;
Read perldoc perlre,
$str =~ s/ / /i;
is the same as:
$str =~ s/\s{2,10}/ /;
Not quite. The \s character class includes more than just the ' '
character.
My bad :D
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi all
I am trying to learn perl. I am using perl afs module to administer our afs
cell. my problem is, the attached script is forking a new process and is not
releasing the memory as iam new to programming I am pretty sure i am doing some
simple mistake I would be really thankfull if one of
Madhur Kashyap wrote:
Hello Perl Experts,
Hello,
I am facing a problem day-in and day-out with my perl code. There are
a couple of subroutines in it. Below I am writing the stub-form of my
perl code.
[code moved to the end of message]
I am calling lot of subroutines in updateNetPairsDB ()
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
: All,
:
: My goal is to get element 9 of stat which is mtime. I am
: getting this with ease, but my end goal is to convert this
: number back into a readable format giving me how old the file
: is.
Are you sure mtime tracks file age? I was
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote:
: Why doesn't this work to check the STDIN until it is one of the
: numbers 1 2 3 4 5 ?? I have tried multiple variations of this with
: different brackets ie. [ ] , and ( ) .
List::MoreUtils exports a function named 'any'. It will allow
you
hi,
is guess_alphabet a predefined function in the following code?
my @counters = ();
while (my $row = $fh) {
my @cols = split /\s*-\s*/, $row;
for (my $i = 0; $i @cols; ++$i) {
my $code = guess_alphabet($cols[$i]);
++$counters[$i]{$code};
}
}
it was giving errors..
please help..
thanks
On
34 matches
Mail list logo