On 6/23/06, Jeff Peng <[EMAIL PROTECTED]> wrote:
>Thanks for the reply Jeff, but what I need to do is assign variables
based
>on the first 5 lines and then push the remaining lines of the file into
an
>array. Any suggestions?
>
Anyway,reading all the contents of a large file to an array should
Thanks for the reply Jeff, but what I need to do is assign variables based
on the first 5 lines and then push the remaining lines of the file into an
array. Any suggestions?
Anyway,reading all the contents of a large file to an array should consume
too much physical memory.Could you take a l
On 6/23/06, Jeff Peng <[EMAIL PROTECTED]> wrote:
Hello,
Reading a file which is large as 900M to the array,should consume memory
too
quickly.
Could you open a file and obtain the file-handle in your subroutine,then
return the file-handle to the caller?For example:
sub your_sub{
ope
Hello,
Reading a file which is large as 900M to the array,should consume memory too
quickly.
Could you open a file and obtain the file-handle in your subroutine,then
return the file-handle to the caller?For example:
sub your_sub{
open (FH,$somefile) or die $!;
return \*FH;
}
F
Hello list!
I am attempting to lower the memory load on the server that the following
lines of code creates. Is there any way to speed up this process and lower
memory usage? I read through FILE::SLURP documentation but not sure if that
would help as I need to keep the array @remaining_file_lines
On 6/22/06, tom arnall <[EMAIL PROTECTED]> wrote:
invoking a perl script with '#!/usr/perl -wd' in its first line and
with './myscript >t' on the command line,
What are you trying to do? The output redirection is confusing to the
debugger. If you're trying to make a transcript of your debugge
invoking a perl script with '#!/usr/perl -wd' in its first line and
with './myscript >t' on the command line, i get as below. i have done this
kind of thing many times, but never with this result. also, the script runs
fine if i drop '>t' from the invocation, or drop '-d' from the first line o
On 6/22/06, tom arnall <[EMAIL PROTECTED]> wrote:
without quitting the current session. It should be a seamless upgrade
WHILE WE ARE RUNNING...
That means that you don't need to restart the CPAN shell to benefit
from the upgrade. You do, however, have to download, build, test, and
install
There's a new CPAN.pm version (v1.87) available!
[Current version is v1.7601]
You might want to try
install Bundle::CPAN
reload cpan
without quitting the current session. It should be a seamless upgrade
WHILE WE ARE RUNNING...
do not the cap'd words mean that i can continue doing
Chad Perrin wrote:
: On Thu, Jun 22, 2006 at 03:07:32AM -0500, Charles K. Clarkson wrote:
::
::: OK, so here is the task. The first row I want to turn into
::: variable names. Machine, PurgeSuccess, etc.
::
:: You probably don't want to do that. You may end up needing
:: symbolic references t
Hello,
$refTime = "01:22:33,456"; #as in your example
$refTime =~ /(\d+):(\d+):(\d+),(\d+)/; #capture the elements and assign
$hours = $1;
$minutes = $2;
$secs = $3;
$mili = $4;
or much simpler:
my($hours, $minutes, $secs, $mili) = $ref_time =~ m{(\d+)}g;
Note that if it doesn't match then t
Here's one thought:
Why not create a hash of arrays? Each hash key would be a column name,
and each record would be spread across the arrays using the same array
index. If you really wanted to get fancy you could create a hash of
cached results to speed up future queries. I wouldn't recommend it
bnj.s wrote:
Hello,
I have a file with lots of times in the format "01:22:33,456", where the
numbers after the comma represent the milliseconds.
I would like to reduce all these times by a given offset. I first
thought to convert the string to a sort of date format, and then to do a
minus o
argument 2 of DateCalc() should be "$days days ago" NOT "$days ago"
sorry
John Ackley wrote:
Khairul Azmi wrote:
Hi all,
I have this problem. There is a script that stores log files into
folders
that follows structure of the following
/MM/DD
eg..
/var/log/projects/2006/06/20/8231.tgz
Khairul Azmi wrote:
Hi all,
I have this problem. There is a script that stores log files into folders
that follows structure of the following
/MM/DD
eg..
/var/log/projects/2006/06/20/8231.tgz
/var/log/project1/2006/06/21/1432.tgz
/var/log/projects/2006/06/22/1756.tgz
/var/log/projects/20
"bnj.s" schreef:
> I have a file with lots of times in the format "01:22:33,456", where
> the numbers after the comma represent the milliseconds.
>
> I would like to reduce all these times by a given offset. I first
> thought to convert the string to a sort of date format, and then to
> do a minus
Hi,
I am trying to use PPM to install some module, I am running version
2.2.0. But I got this error... Is there something happening on the
server side or is this some thing that I need to check with my network?
Is this has to do with ActiveState spinning out?
I am sorry, I didn't know who
On Thu, Jun 22, 2006 at 04:45:25PM +0800, Khairul Azmi wrote:
> Hi all,
> I have this problem. There is a script that stores log files into folders
> that follows structure of the following
>
> /MM/DD
>
> eg..
>
> /var/log/projects/2006/06/20/8231.tgz
> /var/log/project1/2006/06/21/1432.tgz
bnj.s wrote:
Hello,
I have a file with lots of times in the format "01:22:33,456", where the
numbers after the comma represent the milliseconds.
I would like to reduce all these times by a given offset. [...]
You can use POSIX::mktime to convert the string into a time value, but
the millis
On Thu, Jun 22, 2006 at 03:07:32AM -0500, Charles K. Clarkson wrote:
>
> : OK, so here is the task. The first row I want to turn into
> : variable names. Machine, PurgeSuccess, etc.
>
> You probably don't want to do that. You may end up needing
> symbolic references to access those variables
chen li wrote:
: How to convert the format above into an OOP style when
: adding a hyperlink? I am afraid many people might
: have typo if they follow the format above.
First, let's fix a few things with this implementation. Use
the -w or the warnings pragma, not both. The preference is for
On Thu, June 22, 2006 09:25, chen li wrote:
>
>
> --- Prabu <[EMAIL PROTECTED]> wrote:
>
>> Hello,
>>
>> Hope this is your need...
>>
>> #!/usr/bin/perl -w
>> use warnings ;
>>
>> use CGI qw/:standard/;
>> print header, start_html("Stsd ILO Links"), h1("Stsd
>> ILO Links") ;
>>
>> print table({-bo
--- Prabu <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Hope this is your need...
>
> #!/usr/bin/perl -w
> use warnings ;
>
> use CGI qw/:standard/;
> print header, start_html("Stsd ILO Links"), h1("Stsd
> ILO Links") ;
>
> print table({-border=>undef,,-width=>'75%',
> -height=>'70%'},
> caption(s
Hello all,
I have a robot that sends data over a serial connection and I'd like to
use Perl/Linux to listen to the Serial Port and record the data. Can
anyone suggest the best package to do this? I need to be able to set Baud
rates and such too. I'm looking at Device::SerialPort, but is that t
Hello,
I have a file with lots of times in the format "01:22:33,456", where the
numbers after the comma represent the milliseconds.
I would like to reduce all these times by a given offset. I first
thought to convert the string to a sort of date format, and then to do a
minus operation, and
On Thu, 2006-22-06 at 16:45 +0800, Khairul Azmi wrote:
> Hi all,
> I have this problem. There is a script that stores log files into folders
> that follows structure of the following
>
> /MM/DD
>
> eg..
>
> /var/log/projects/2006/06/20/8231.tgz
> /var/log/project1/2006/06/21/1432.tgz
> /var/
On Thu, 2006-22-06 at 01:47 +, Jeff Peng wrote:
> > > This conversion to and fro must be inefficient and time consuming. Is
> > > there a "better" way to do this?
> >
> >Use an anonymous array:
> >
> > $array{$client} = [ @field ];
> >
> > @field = @{ $array{$client} };
> >
> >
>
> Or use
Hi Preethi
Can you try...
perl -pi.bak -e 's/(ab=test1.*?dc=test3)/ab=chk1,bc=chk2/sg' filename
[untested]
Thanks
Prasanna
-Original Message-
From: Preethi [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 22, 2006 3:21 PM
To: Dr.Ruud
Cc: beginners@perl.org
Subject: Re: Urgent :sear
Preethi schreef:
> The below solution
... should be above, but most probably snipped.
Don't top-post, quote only relevant text, reply on each part that you
quote.
> did not work for me. My file runs almost to 1GB.
What was the error message?
Also show us the output of this:
perl -wne '
$
Hi Ruud,
Thanks for the input. I will take care of your inputs next time I post the
message.
The below solution did not work for me . My file runs almost to 1GB . All I
have the string mentioned below.
I even tried the following option
perl -pi.bak -0777 -e 's/ab=test1, db=test2,dc=test3/ab=chk
Preethi schreef:
Never put "Urgent" in the Subject. Never address "us" as Experts. Just
explain your problem.
Subject: search and replace on broken lines
> I have wired problem , I have search and replace string in very huge
> text file . The problem with the string is broken in the differenet
Hi all,
I have this problem. There is a script that stores log files into folders
that follows structure of the following
/MM/DD
eg..
/var/log/projects/2006/06/20/8231.tgz
/var/log/project1/2006/06/21/1432.tgz
/var/log/projects/2006/06/22/1756.tgz
/var/log/projects/2006/06/23/1756.tgz
Now
Hi Prabhu,
Your guess is right.For each box it should go to a different
link.
For e.g my references are like this. href="https://192.10.11.12.
I want my code to be slightly simple.
Thanx,
Alok.
-Original Message-
From: Prabu [mailto:[EMAIL PROTECTED]
Sent: Thurs
Prabu wrote:
: use CGI qw/:standard/;
[snip]
: th(['','Network Switch','Bay 1','Bay 2','Bay 3' ,'Network
: Switch' ]),
Sorry, that will produce invalid xhtml 1.0 Transitional, the
default DOCTYPE for CGI.pm. Better to use the a() function
already loaded into the main namespace by the 'use' st
Hello Alok,
FineBut each box needs to go to different link right.So it
should be specified in each box ..
If not can u a give me little more detailed requirement like on clicking
the link in box where it should go.and so...
--
Prabu.M.A
When I was born I was so surprised
Ralph H. Stoos Jr. wrote:
Perl is a name, not an acronym. Write Perl or perl, but never
PERL (unless you are yelling).
: OK, so here is the task. The first row I want to turn into
: variable names. Machine, PurgeSuccess, etc.
You probably don't want to do that. You may end up needing
s
Hi Prabhu,
Is there any simple way of doing it.Bcos this looks like user
has to type a lot.
Perl is known for its simplicity I suppose.
Thanx,
Alok.
-Original Message-
From: Prabu [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 22, 2006 12:06 PM
To: Nath, Alok (STSD)
Cc:
"Ralph H. Stoos Jr." schreef:
> Machine,PurgeSuccess,PurgePrepared,PurgeStarted,...
> 1125785731,N,Y,Y,...
> 1125785731,Y,Y,N,
>
> Above is the same slice of data. It all lines up in neat little
> columns when you drop it into a spreadsheet. Admittedly, it could be
> plopped into all sorts o
You have 2 options:
1) Use pattern matching which would help in replacement
s//
2) Try using split function
$w=split(//,$string to search)
3) Try using substr function
Substr($string to search, )
-Original Message-
From: Preethi [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 22, 2006
Nath, Alok (STSD) wrote:
Hi,
I was trying to add a hyperlink to each of the boxes but it was
not putting
it in the right place.Can anyone help me in this regard ?
[...]
Try this:
td([
a({href=>'http://url.example.com'}, 'My link text')
])
--
To unsubscribe, e-mail: [EMAIL PRO
All,
I have been asked to do something in Access or Excel which I find
disagreeable. Open Source is the way to go and also, PERL is more
flexible. I might even obtain a little professional development on this.
My last post seemed to confuse folks (thanks to all who responded). I
will try to cl
Hi Experts,
I have wired problem , I have search and replace string in very huge text
file . The problem with the string is broken in the differenet line.
I'm having a string 'ab=test1, db=test2,dc=test3' and I want to replace
this with 'ab=chk1,bc=chk2'.
This string in the file is present in v
42 matches
Mail list logo