Dear List
I need to collect bulk data files from some remote machines into my local
machine. I will be using a perl script to read about the remote machines
directory listing from where I will get the source data files.The remote
machines' directory listing from where I will get the data files
I use SCP. About faster or not, it depends on the bandwidth in both
locations and load CPU in each locations.
On Thu, Mar 27, 2008 at 1:16 PM, Anirban Adhikary
[EMAIL PROTECTED] wrote:
Dear List
I need to collect bulk data files from some remote machines into my local
machine. I will be
Zentara, gtkdatabox looks good for me. Can you please mention
which perl module in Gtk2::* should I use to use this from perl?
Thanks!
On Wed, Mar 26, 2008 at 5:23 PM, zentara [EMAIL PROTECTED] wrote:
On Wed, 26 Mar 2008 00:22:03 +0530, [EMAIL PROTECTED] (Gowtham
M) wrote:
Thanks for the
Here is the entire code to accomplish your task. It will delete 1st 3rd
lines.
use warnings;
use strict;
my @array;
open FH,data.txt;
@array = FH;
for my $i (0..$#array)
{
$array[$i] =~ s/^(\*\/tmp\/dst\/file(1|3)\*(\d){3}\*RW\*(\d){3,4})$/ /;
#replace the lines you want to delete with
Here is the entire code to accomplish your task. It will delete 1st 3rd
lines.
use warnings;
use strict;
my @array;
open FH,data.txt;
@array = FH;
for my $i (0..$#array)
{
$array[$i] =~ s/^(\*\/tmp\/dst\/file(1|3)\*(\d){3}\*RW\*(\d){3,4})$/ /;
#replace the lines you want to delete with
[ Please do not top-post your replies. TIA ]
sanket vaidya wrote:
Here is the entire code to accomplish your task. It will delete 1st 3rd
lines.
use warnings;
use strict;
my @array;
open FH,data.txt;
You should *always* verify that the file opened correctly:
open FH, '', 'data.txt' or
[EMAIL PROTECTED] wrote:
Hi,
I am doing some studies on sub modules and Lexical variables (my).
With regards to diagram 1 below, what can I do so that the lexical $counter can count up to 4.
Of course, one way of doing this is to change the lexical $counter into a global variable as
Hi I copied the code into a script so I could be sure it was the exactly the
same source being used on version 5.8.8 and 5.10.0. I'm running an AMD
Athlon64 x2 Ubuntu 7.10 but that is I think irrelevant.
For those not familiar with vim line #2 turns off syntax colouring for this
file only.Its
I am really going crazy here. I have the following system call that I
would like to run from perl:
ls *.txt | xargs cat out
if *.txt does not exist then I expect to get an exit code different
from 0.
So to test I do:
use strict;
my $f = file_which_does_not_exist;
# method 1
print test 1\n;
This is because you send ls's output to a pipe, and the command on the
right of the pipe get executed successfully.
Try this test on shell:
-bash-3.00$ ls |xargs cat
ls: : No such file or directory
-bash-3.00$ echo $?
0
-bash-3.00$ ls
ls: : No such file or directory
-bash-3.00$
On Wed, Mar 26, 2008 at 9:47 PM, Rob Dixon [EMAIL PROTECTED] wrote:
Jay Savage wrote:
If you want to see grep really shine, though, think about ways you
might use it to avoid calling print for every element in the return
list, e.g.
print join \n, grep {$_ % 2 == 0} @list;
- Original Message -
From: Gunnar Hjalmarsson [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Thursday, March 27, 2008 8:27 AM
Subject: Re: question on lexical declaration and submodule
...
but I dont think this is a good idea as the sub-module will then have a
mixture of both
sanket vaidya wrote:
Whereas the output on perl 5.6.1 is
Hello!!1
Ummm, beg to differ
#!/usr/bin/perl
use strict;
use warnings;
sub hello;
my $ref = \hello;
{$ref};
sub hello {
print hello!!;
}
[EMAIL PROTECTED]:~$ perl -l pbml.pl
hello!!
[EMAIL PROTECTED]:~$ perl -v
This is perl,
Can some one pls tell me wts the meaning of $topIter-next() ?
I know - is used for hash refs, but dont know when to use -( ) !!!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 27 мар, 03:50, [EMAIL PROTECTED] (Ultra Star X) wrote:
I am really going crazy here. I have the following system call that I
would like to run from perl:
ls *.txt | xargs cat out
if *.txt does not exist then I expect to get an exit code different
from 0.
So to test I do:
use strict;
On Wed, Mar 26, 2008 at 9:47 PM, Rob Dixon [EMAIL PROTECTED] wrote:
Jay Savage wrote:
If you want to see grep really shine, though, think about ways you
might use it to avoid calling print for every element in the return
list, e.g.
print join \n, grep {$_ % 2 == 0} @list;
From: Subra [EMAIL PROTECTED]
Can some one pls tell me wts the meaning of $topIter-next() ?
I know - is used for hash refs, but dont know when to use -( ) !!!
- is used for any references. And for method calls. In this case you
are calling the next() method of the $topIter object.
Jenda
Hi,
Current task requires me to combine a few files into a single file
( abc. txt ) where in each file has to be in a single page. I was able
to create a combined file, but not able to ensure that each file
resides in a page. Attempted a few things like 'format_lines_left'
i.e $-. in vain... One
I tried gtkdatabox.
The C language version works fine on my machine, but the
perl module doesn't compile :(
I get this error:
Databox.xs: In function `gtk_databox_data_type_get_type':
Databox.xs:75: `GTK_DATABOX_NOT_DISPLAYED' undeclared (first use in this
function)
Databox.xs:75: (Each
Jay Savage wrote:
On Wed, Mar 26, 2008 at 9:47 PM, Rob Dixon [EMAIL PROTECTED] wrote:
Jay Savage wrote:
If you want to see grep really shine, though, think about ways you
might use it to avoid calling print for every element in the return
list, e.g.
print join \n, grep {$_ % 2 == 0}
sanket vaidya wrote:
Hi everyone,
Kindly go through the code below.
use strict;
use warnings;
sub hello;
my $ref = \hello;
{$ref};
sub hello
{
print hello!!;
}
The output on perl 5.10 is
Hello!!
Whereas the output on perl 5.6.1 is
Hello!!1
Why two different outputs in two
Thank you very much for explaining. I will try what Sandy suggested.
I had tested at the command line already just as Jeff did. The
confusion came from the fact that I had tried it in csh and in csh,
doing the ls |xargs cat returned 1. Annoying.
C.
--
To unsubscribe, e-mail: [EMAIL
[EMAIL PROTECTED] wrote:
In a large program, I guess there may be many programmers involved
and each of these programmers are responsible to write their own sub
rountine as required. Henceforth it will be very confusing and
problematic if the programmers have to use variables from outside of
Text files don't /have/ pages. The number of lines per page depends
on the printer driver - the font size, margin size, etc.
If you know the number of lines the print driver does per page, you
can fill to that point with newlines based on the number of lines
already outputted.
Or you might be
Just posted to clpmisc:
Original Message
Subject: Re: Operator -()
Date: Thu, 27 Mar 2008 20:35:27 +0100
From: Gunnar Hjalmarsson [EMAIL PROTECTED]
Newsgroups: comp.lang.perl.misc
Subra wrote:
[ exactly the same question as was posted to the beginners list a few
minutes
On Thu, Mar 27, 2008 at 2:22 PM, Rob Dixon [EMAIL PROTECTED] wrote:
Yes I understood your intention, but efficiency isn't everything by any
means. I believe very firmly that programs should be coded in the
clearest and most obvious way possible, then tested and optimised if the
Jay Savage wrote:
[snip]
In any case, if someone offered me a way of making my program run
in 20ms instead of 25ms I wouldn't be overly impressed, and
certainly don't see it as a case of grep 'shining'.
I think you missed my point. I may not have been clear. No, shaving a
few ms off runtime
Given a multiple char patterns like :C9 that repeated, how to write
a regex that repeat the patterns( which is non-atom ) 6 times. like
in
below
WWPN:10:00:00:00:c9:2e:e8:90
I tried to define pattern to match
my $match= qr/ {:[0-9a-e][0-9a-e]}{6} /;
print matched if /$match/ ;
but it
Hi!
I am looking for a way of moving files older than a date,
I am need this in a script for moving/erase old files from a
production machine
Any tips where to read more about this i gratefull, i can't find any,
(it is on a Windows server) and i would like to stick to PERL standard
package
ciwei wrote:
Given a multiple char patterns like :C9 that repeated, how to write
a regex that repeat the patterns( which is non-atom ) 6 times. like
in below
WWPN:10:00:00:00:c9:2e:e8:90
I tried to define pattern to match
my $match= qr/ {:[0-9a-e][0-9a-e]}{6} /;
print matched if
To get the date of a file:
perldoc stat
http://perldoc.perl.org/functions/stat.html
For moving files:
http://perldoc.perl.org/perlfaq5.html#How-can-I-reliably-rename-a-file%3f
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Gunnar Hjalmarsson wrote:
Rob Dixon wrote:
Richard Lee wrote:
Gunnar Hjalmarsson wrote:
C:\hometype test.pl
use Data::Dumper;
my %HoA = (
something = [ qw/val1 val2 val3 and so forth/ ],
something2 = [ qw/vala valb valc and so forth/ ],
something3 = [ qw/valZ valZ1 valZ2 so
Rob Dixon wrote:
ciwei wrote:
Given a multiple char patterns like :C9 that repeated, how to write
a regex that repeat the patterns( which is non-atom ) 6 times. like
in below
WWPN:10:00:00:00:c9:2e:e8:90
I tried to define pattern to match
my $match= qr/ {:[0-9a-e][0-9a-e]}{6} /;
print
Hi all
I have some files stored in directory resumes1 (say the files are file1,
file2 file3).
When I run the following code
use warnings;
use strict;
use File::Find;
find (\del,D:/resumes1);
sub del
{
print File name is $_\n ;
}
The output is:
File name is
On 3/28/08, sanket vaidya [EMAIL PROTECTED] wrote:
Where did this . come from how to eliminate it?
'.' means the current directory.
to remove it, add a line at the begin of the callback function:
return if /^\.+$/;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
35 matches
Mail list logo