Updated to fix memory problem, you have to purge. Takes over 30
minutes for 120K records.
I am sure that the whole process can be done better with a good
understanding of the module. Will benchmark XML::Rules though.
On Tue, 2008-03-18 at 00:55 +1100, Ken Foskey wrote:
> I am extracting addre
R (Chandra) Chandrasekhar wrote:
Dear Folks,
Hello,
I want to comment out certain lines in a file that match a particular
pattern. The file contains lines with characters like: {, }, ==, and ".
'{' is only special in a regular expression if it is immediately
followed by a numerical digit,
Dear Folks,
I want to comment out certain lines in a file that match a particular pattern.
The file contains lines with characters like: {, }, ==, and ". Specifically, I
want to replace lines beginning with
ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0109",
with
# ATTRS{idVendor}=="07b4", A
Say you have the string "abcdefghi".
The positions in the string are:
a b c d e f g h i
^ ^ ^ ^ ^ ^ ^ ^ ^ ^
0 1 2 3 4 5 6 7 8 9
If you have the regular expression:
/(de)/
Then the match starts at position 3, moves forward two characters, and
ends at position 5, where the next match, i
Greetings,
I am not familiar at all with Perl, but from my experiences with MS-DOS, if you
want to have the CLI read something, IE file name or path, then you need to
enclose the filename and path in quotes. So if you could try to enclose the path
in quotes, that may work.
Regards,
Mike Wohlrab
On 17 Mar 2008, at 21:58, Gunnar Hjalmarsson wrote:
In this case, if I understand it correctly, the default version of
the page, with a form, would appear. Why would that be a problem for
anybody but the stupid user? ;-)
Fundamentally, don't make it possible for your users to do anything
Hmm... I did not see this appear on the list so I'm posting it again. I'm using
cygwin perl on windows and as you can see below, cpan seems to choking on the
path name "/cygdrive/c/Documents and settings/a-siehei/My Documents" because of
the spaces.
Surely someone else has a workaround!
My a
Dermot wrote:
Hi,
Hello,
I have a cgi script that writes to a disk file. It would be safest if I can
get an exclusive lock on the file. I had a look at the opentut and believe I
have followed that the example there. Here's what I have
sysopen my $fh, $file_path, O_WRONLY || die "can't open $
Paul Lalli wrote:
On Mar 17, 2:46 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
if ( ! $action ) {...}
That'll work great until some jackass puts "?action=0" in the URL.
So what? If you put random crap in the URL, you can't reasonably expect
a meaningful response.
In this case,
From: Ken Foskey <[EMAIL PROTECTED]>
> I am extracting addresses from an XML file to process through other
> programs using pipe delimiter the following code works but this is going
> to get 130,000 records through it it must be very efficient and I cannot
> follow the documentation on the best w
Dermot wrote:
I have a cgi script that writes to a disk file. It would be safest if I can
get an exclusive lock on the file. I had a look at the opentut and believe I
have followed that the example there. Here's what I have
sysopen my $fh, $file_path, O_WRONLY || die "can't open
$
Dermot schreef:
>sysopen my $fh, $file_path, O_WRONLY
>|| die "can't open $file_path: $!\n";
Change or-operator (or use parenthesis).
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Hi,
I have a cgi script that writes to a disk file. It would be safest if I can
get an exclusive lock on the file. I had a look at the opentut and believe I
have followed that the example there. Here's what I have
sysopen my $fh, $file_path, O_WRONLY || die "can't open
$file_path:
On Mon, Mar 17, 2008 at 9:55 AM, Ken Foskey <[EMAIL PROTECTED]> wrote:
>
> I am extracting addresses from an XML file to process through other
> programs using pipe delimiter the following code works but this is going
> to get 130,000 records through it it must be very efficient and I cannot
>
On Mon, Mar 17, 2008 at 12:04 PM, Paul Lalli <[EMAIL PROTECTED]> wrote:
> On Mar 17, 2:46 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
> > Kashif Salman wrote:
> > > I have a CGI script; when it runs the very first time I define some
> variables
> > > my $action = $q->param('action');
> >
On Mon, Mar 17, 2008 at 3:02 PM, Anirban Adhikary
<[EMAIL PROTECTED]> wrote:
> Dear List
> I want to write a script using TCP protocol where will be a single server
> which can handle multiple client request simultaneously. I am able to
> write a script using IO::Socket but In these scripts my
On Mar 17, 2:46 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
> Kashif Salman wrote:
> > I have a CGI script; when it runs the very first time I define some
> > variables
> > my $action = $q->param('action');
>
> > The first time it runs, parameter 'action' isn't defined so that is
> > how I c
On Mar 17, 2:08 pm, [EMAIL PROTECTED] (Kashif Salman) wrote:
> Hello,
> I have a CGI script; when it runs the very first time I define some variables
> my $action = $q->param('action');
>
> The first time it runs, parameter 'action' isn't defined so that is
> how I check that it is running the firs
Dear List
I want to write a script using TCP protocol where will be a single server
which can handle multiple client request simultaneously. I am able to
write a script using IO::Socket but In these scripts my server can handle
single client suppose my server is printing the IP address of the cli
Kashif Salman wrote:
Hello,
Hello,
I have a CGI script; when it runs the very first time I define some variables
my $action = $q->param('action');
The first time it runs, parameter 'action' isn't defined so that is
how I check that it is running the first time and do my things
if ($aciton e
On Mon, Mar 17, 2008 at 11:46 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
>
> Kashif Salman wrote:
> > I have a CGI script; when it runs the very first time I define some
> variables
> > my $action = $q->param('action');
> >
> > The first time it runs, parameter 'action' isn't defined so
Kashif Salman wrote:
I have a CGI script; when it runs the very first time I define some variables
my $action = $q->param('action');
The first time it runs, parameter 'action' isn't defined so that is
how I check that it is running the first time and do my things
if ($aciton eq "") {...}
elsif
I think you want:
if( defined $q->param('action') ) {
} else {
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
[EMAIL PROTECTED] wrote:
I want to compare the two files in Perl. The requirement is that file 1
has 20 lines and file2 has 25 lines . I want to see only five lines as
output which are there in file2 not in file1 as I know that rest of the
20 lines are same in both the files.
I am using the foll
Hello,
I have a CGI script; when it runs the very first time I define some variables
my $action = $q->param('action');
The first time it runs, parameter 'action' isn't defined so that is
how I check that it is running the first time and do my things
if ($aciton eq "") {...}
elsif ($action eq "sub
On Mar 14, 3:26 pm, [EMAIL PROTECTED] (Manoj) wrote:
> When using Data: Dumper is taking more time for my 1 lines of CSV file.
> This solved a few queries...and the benchmark was a new value addition for
> me. Thanks
> > 2) Is there any optimal method for reading a CSV file and put to
> h
Ken Foskey wrote:
I am extracting addresses from an XML file to process through other
programs using pipe delimiter the following code works but this is going
to get 130,000 records through it it must be very efficient and I cannot
follow the documentation on the best way to do this.
After this
[EMAIL PROTECTED] asked:
> I have certain doubts.
>
> What's the meaning of " if
> mysubroutine was defined with prototypes and you were trying
> to disable that" sentence.
>
> Could you please elaborate that what's the meaning of this???
When declaring a subroutine, you can optionally also d
[EMAIL PROTECTED] asked;
> How is it possible to initialize variable using 0 or '' and
> not having undef warning later on using them?
my $variable = 0; # <= initial value goes here
HTH,
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http
On Mon, Mar 17, 2008 at 10:34 AM, Sharan Basappa
<[EMAIL PROTECTED]> wrote:
> Rob,
>
> Actually you are correct. I was on my way to implement permutation for
> a given set of numbers.
> In that context, I had designed my own algo as a part of bigger
> problem I am trying to solve.
> That algo
Rob,
Actually you are correct. I was on my way to implement permutation for
a given set of numbers.
In that context, I had designed my own algo as a part of bigger
problem I am trying to solve.
That algo requires rotate and factorial. Rotate to get different
combinations and factorial to limit for
Hi All,
I want to compare the two files in Perl. The requirement is that file 1
has 20 lines and file2 has 25 lines . I want to see only five lines as
output which are there in file2 not in file1 as I know that rest of the
20 lines are same in both the files.
I am using the following commands
On Mar 17, 7:40 am, [EMAIL PROTECTED] (Irfan Sayed) wrote:
> Hi All,
>
> Can somebody please let me know the meaning of this line.
>
> while (<$in>)
>
> {
>
> if(/,/) {print "before match: $`\t and after match: $'\n\n";}; $x=$';
> $y=$`; &mysubroutine($x,$y);
>
> }
>
> I know it is a while loop for
On Mon, Mar 17, 2008 at 7:12 AM, <[EMAIL PROTECTED]> wrote:
> Are subs always return references or only for anonymous lists/hashes?
perldoc perlsub
"The Perl model for function call and return values is simple: all
functions are passed as parameters one single flat list of scalars,
and all funct
On Mar 17, 7:40 am, [EMAIL PROTECTED] (Irfan Sayed) wrote:
> Hi All,
>
> Can somebody please let me know the meaning of this line.
>
> while (<$in>)
>
> {
>
> if(/,/) {print "before match: $`\t and after match: $'\n\n";}; $x=$';
> $y=$`; &mysubroutine($x,$y);
>
> }
>
> I know it is a while loop for
I am extracting addresses from an XML file to process through other
programs using pipe delimiter the following code works but this is going
to get 130,000 records through it it must be very efficient and I cannot
follow the documentation on the best way to do this.
After this simple one is progr
On Mon, Mar 17, 2008 at 6:51 AM, <[EMAIL PROTECTED]> wrote:
> How is it possible to initialize variable using 0 or '' and not having
> undef warning later on using them?
snip
Well, you can say
my $var = 0;
but that doesn't prevent the variable from being set to undef later,
so if it is possibl
[EMAIL PROTECTED] asked
> Can somebody please let me know the meaning of this line.
>
>
>
> while (<$in>)
>
> {
> if(/,/) {print "before match: $`\t and after match:
> $'\n\n";}; $x=$'; $y=$`; &mysubroutine($x,$y);
> }
The loop iterates over a filehandle, setting $_ to each
line in turn. If
On Mar 17, 2008, at 11:51 , [EMAIL PROTECTED] wrote:
How is it possible to initialize variable using 0 or '' and not having
undef warning later on using them?
Not reassigning to undef.
-- fxn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
htt
How is it possible to initialize variable using 0 or '' and not having
undef warning later on using them?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 16 Mar, 18:30, [EMAIL PROTECTED] (Yitzle) wrote:
> On Sun, Mar 16, 2008 at 12:54 PM, John W. Krahn <[EMAIL PROTECTED]> wrote:
>
> > >> push @records, %record
> > > I think you want an array of references, not of hashed themselves.
>
> > Actually, the hash is converted to a list and that list
Hi All,
Can somebody please let me know the meaning of this line.
while (<$in>)
{
if(/,/) {print "before match: $`\t and after match: $'\n\n";}; $x=$';
$y=$`; &mysubroutine($x,$y);
}
I know it is a while loop for the file handle ($in) and it will be
executed till the end of file b
42 matches
Mail list logo