Re: Skipping X Number of Iterations before Stopping on a Break Point

2014-02-28 Thread Martin G. McCormick
Shlomi Fish writes: > Hi Martin, > I know of several options for that: > > 1. Use a package-scope count variable: e.g, do: > > <> > > 2. source a file (see "source" on "perldoc perldebug") that will contain > several "c" statements. > > 3. Maybe try Devel::Trepan instead: > https://metacpan.o

Re: Skipping X Number of Iterations before Stopping on a Break Point

2014-02-28 Thread Shlomi Fish
Hi Martin, On Thu, 27 Feb 2014 15:33:57 -0600 "Martin G. McCormick" wrote: > I am running a script under perl -d and want to break > execution at line 243 in this case. > perl -d scriptname loads the script in to the debugger and b 243 > sets the break point. c then Enter starts the progra

Skipping X Number of Iterations before Stopping on a Break Point

2014-02-27 Thread Martin G. McCormick
I am running a script under perl -d and want to break execution at line 243 in this case. perl -d scriptname loads the script in to the debugger and b 243 sets the break point. c then Enter starts the program which runs until it reaches the desired line at which point it stops. All I want t

Re: Simulate `sh -x'

2011-12-03 Thread Peter Scott
On Jun 24 2002, 4:44 am, davidtg-perl-beginn...@justpickone.org (David T- G) wrote: > ...and then Peter Scott said... > % >% Would you like tracing that goes off when you go into a function? Suppose > % >% if you gave a numeric argument to 't' it would trace up to that depth > % >% in subroutine

Re: DBD-mysql-4.020 on OS X 10.6.8: install problem

2011-10-21 Thread Phil Dobbin
On 21/10/11 at 10:12, phildob...@gmail.com (Phil Dobbin) wrote: On 20/10/11 at 17:35, phildob...@gmail.com (Phil Dobbin) wrote: I’m trying to install DBD-mysql-4.020 on OS X 10.6.8 with a fresh install of perl in /usr/local/ (perl 5.14.2) which is in my $PATH. [snip] If anybody’s

Re: DBD-mysql-4.020 on OS X 10.6.8: install problem

2011-10-21 Thread Phil Dobbin
On 20/10/11 at 17:35, phildob...@gmail.com (Phil Dobbin) wrote: I’m trying to install DBD-mysql-4.020 on OS X 10.6.8 with a fresh install of perl in /usr/local/ (perl 5.14.2) which is in my $PATH. [snip] [snip

DBD-mysql-4.020 on OS X 10.6.8: install problem

2011-10-20 Thread Phil Dobbin
Hi. I’m trying to install DBD-mysql-4.020 on OS X 10.6.8 with a fresh install of perl in /usr/local/ (perl 5.14.2) which is in my $PATH. I have a working MySql in /usr/local/ (MySQL 5.1.59) & the latest Bundle-DBI. I’ve tried from CPAN & compiling from source, scoured the Int

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-19 Thread Phil Dobbin
On 19/10/11 at 18:33, j.madrig...@miami.edu (Madrigal, Juan A) wrote: Just wanted to let everyone know I finally fixed the issue. I removed the default perl install in Mac OS X 10.6.8 and compiled a clean install of perl 5.10.1 in its place. [snip] Am I right in thinking you did a fresh

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-19 Thread Madrigal, Juan A
Just wanted to let everyone know I finally fixed the issue. I removed the default perl install in Mac OS X 10.6.8 and compiled a clean install of perl 5.10.1 in its place. Here are the steps to replicate: sudo rm -R /System/Library/Perl sudo rm -R /Library/Perl rm /usr/bin/cpan* rm /usr/bin

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Madrigal, Juan A
Thanks Phil! I installed Perl 5.14.2 and DateTime seems to have installed except that DateTime.pm is missing. When I point to the lib directory via the use command DateTime shows up in my IDE (Komodo) but with an error message when I hover over use DateTime: "BEGIN failed --Compilation aborted."

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Phil Dobbin
On 18/10/11 at 16:22, j.madrig...@miami.edu (Madrigal, Juan A) wrote: [...] > Any advice on installing a fresh install of perl and cpan in a different > directory? > > Flags etc...? Cheers, Phil. --

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Madrigal, Juan A
/bin/less], >> 'patch' => q[/usr/bin/patch], >> 'prefer_installer' => q[MB], >> 'prefs_dir' => q[/Users/juan/.cpan/prefs], >> 'prerequisites_policy' => q[ask], >> 'scan_cache' => q[atstart], >>

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Ryan Munson
t; q[/Users/juan/.cpan/prefs], > 'prerequisites_policy' => q[ask], > 'scan_cache' => q[atstart], > 'shell' => q[/bin/bash], > 'show_unparsable_versions' => q[0], > 'show_upload_date' => q[0], > 'show_zero_ve

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Madrigal, Juan A
n/bash], 'show_unparsable_versions' => q[0], 'show_upload_date' => q[0], 'show_zero_versions' => q[0], 'tar' => q[/usr/bin/tar], 'tar_verbosity' => q[v], 'term_is_latin' => q[1], 'term_ornaments&#x

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Randal L. Schwartz
> "Juan" == "Madrigal, Juan A" writes: [something unrelated to the parent of this message] Please don't hijack a thread. Don't start a new thread by replying to a previous item and then just editing the subject line. Your message has *nothing* to do with my posting. If you need help with

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Rob Coops
On Tue, Oct 18, 2011 at 4:20 PM, Madrigal, Juan A wrote: > Hi All! > > I'm having serious problems trying to install DateTime-0.70 along with > pre-requisites Params-Validate-1.00 > on Mac OS X 10.6.8 via CPAN. > > I'm using the default install of Perl 5.10 (64bit).

Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Madrigal, Juan A
Hi All! I'm having serious problems trying to install DateTime-0.70 along with pre-requisites Params-Validate-1.00 on Mac OS X 10.6.8 via CPAN. I'm using the default install of Perl 5.10 (64bit). What jumps out to me is this: "Error: no compiler detected to compile 'lib/DateT

Re: transposing %d values to %x output

2011-03-30 Thread Chas. Owens
On Wed, Mar 30, 2011 at 00:28, Brian Fraser wrote: > On Wed, Mar 30, 2011 at 12:46 AM, Chas. Owens wrote: >> >> If you are dealing exclusively with ASCII, then you should be using >>  the [bytes][0] pragma; > > It's nitpicky, but I'd advice against ever recommending use bytes in the > beginners l

Re: transposing %d values to %x output

2011-03-30 Thread Jenda Krynicky
From: Jim Gibson > At 9:18 PM -0400 3/29/11, Chas. Owens wrote: > > >It is important to note that \d > >doesn't match what you think it does. Starting with Perl 5.8, \d > >matches and digit character. This includes characters such as > >"\x{1815}"

Re: transposing %d values to %x output

2011-03-29 Thread John W. Krahn
ck, easily readable way to get the value $1, $2, $3, $4 >>> to be rewriten as %x instead of a %d? >> >> s/(\d+)\.(\d+)\.(\d+)\.(\d+)/sprintf('%x:%x:%x:%x::0',$1,$2,$3,$4)/e; JWK> Might be better as: JWK> sprintf '%x:%x:%x:%x::0', /(\d+)\.(\

Re: transposing %d values to %x output

2011-03-29 Thread Uri Guttman
>>>>> "JWK" == John W Krahn writes: JWK> Shawn H Corey wrote: >> On 11-03-29 07:50 PM, Noah Garrett Wallach wrote: >>> >>> s/(\d+)\.(\d+)\.(\d+)\.(\d+)/$1:$2:$3:$4::0/ >>> >>> so is there a slick, easily r

Re: transposing %d values to %x output

2011-03-29 Thread John W. Krahn
Shawn H Corey wrote: On 11-03-29 07:50 PM, Noah Garrett Wallach wrote: s/(\d+)\.(\d+)\.(\d+)\.(\d+)/$1:$2:$3:$4::0/ so is there a slick, easily readable way to get the value $1, $2, $3, $4 to be rewriten as %x instead of a %d? s/(\d+)\.(\d+)\.(\d+)\.(\d+)/sprintf('%x:%x:%x:%x::0'

Re: transposing %d values to %x output

2011-03-29 Thread Brian Fraser
On Wed, Mar 30, 2011 at 12:46 AM, Chas. Owens wrote: > > If you are dealing exclusively with ASCII, then you should be using > the [bytes][0] pragma; It's nitpicky, but I'd advice against ever recommending use bytes in the beginners list. Or any list really. See: http://www.nntp.perl.org/group

Re: transposing %d values to %x output

2011-03-29 Thread Chas. Owens
stray if you happened to match something that wasn't [0-9]: #!/usr/bin/perl use strict; use warnings; binmode STDOUT, ":utf8"; my $s = "\x{ff15}.\x{ff15}.\x{ff15}.\x{ff15}"; print "$s\n"; $s =~ s/(\d+)[.](\d+)[.](\d+)[.](\d+)/sprintf "%x.%x.%x.%x", $1,

Re: transposing %d values to %x output

2011-03-29 Thread Brian Fraser
On Tue, Mar 29, 2011 at 11:03 PM, Jim Gibson wrote: > > The statement "To match the ASCII digit characters you must use [0-9]" is > wrong. I believe you meant to say "To match the ASCII digit characters and > only those characters, you must use [0-9]". Or \p{PosixDigit}; Teach new people Unicode

Re: transposing %d values to %x output

2011-03-29 Thread Jim Gibson
At 9:18 PM -0400 3/29/11, Chas. Owens wrote: It is important to note that \d doesn't match what you think it does. Starting with Perl 5.8, \d matches and digit character. This includes characters such as "\x{1815}" (Mongolian digit five). To match the ASCII digit characters yo

Re: transposing %d values to %x output

2011-03-29 Thread Chas. Owens
On Tue, Mar 29, 2011 at 19:50, Noah Garrett Wallach wrote: snip > s/(\d+)\.(\d+)\.(\d+)\.(\d+)/$1:$2:$3:$4::0/ > > so is there a slick, easily readable way  to get the value $1, $2, $3, $4 to > be rewriten as  %x instead of a %d? snip The [eval regex modifier (e)][0] will le

Re: transposing %d values to %x output

2011-03-29 Thread Jim Gibson
On 3/29/11 Tue Mar 29, 2011 4:50 PM, "Noah Garrett Wallach" scribbled: > Hi there, > > s/(\d+)\.(\d+)\.(\d+)\.(\d+)/$1:$2:$3:$4::0/ > > so is there a slick, easily readable way to get the value $1, $2, $3, > $4 to be rewriten as %x instead of a %d? Try this:

Re: transposing %d values to %x output

2011-03-29 Thread Shawn H Corey
On 11-03-29 07:50 PM, Noah Garrett Wallach wrote: Hi there, s/(\d+)\.(\d+)\.(\d+)\.(\d+)/$1:$2:$3:$4::0/ so is there a slick, easily readable way to get the value $1, $2, $3, $4 to be rewriten as %x instead of a %d? s/(\d+)\.(\d+)\.(\d+)\.(\d+)/sprintf('%x:%x:%x:%x::0',$1,$2,$3,$

transposing %d values to %x output

2011-03-29 Thread Noah Garrett Wallach
Hi there, s/(\d+)\.(\d+)\.(\d+)\.(\d+)/$1:$2:$3:$4::0/ so is there a slick, easily readable way to get the value $1, $2, $3, $4 to be rewriten as %x instead of a %d? Cheers, Noah -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h

Re: Re:must 'x' in g^x be a prime number

2011-03-23 Thread fakessh @
i paste a discussion to openssl-users how to implement this attack in perl Le mercredi 23 mars 2011 à 09:13 +0800, Ziyu Liu a écrit : > 1)The exponent x in DH can be any number.It should be big enough to > bear attack.The source in DH told us what exponent x can be. > ref:dh_key.c

Re: x,y axis graph

2011-02-16 Thread Scott Hall
On Tue, Feb 15, 2011 at 9:35 PM, Chris Stinemetz < cstinem...@cricketcommunications.com> wrote: > I am interested in creating a cgi perl script that I can publish on the web > that will tie into a mysql database and create a x,y axis graph based on > data selection. Any suggesti

Re: x,y axis graph

2011-02-16 Thread Peter Scott
On Tue, 15 Feb 2011 19:35:03 -0700, Chris Stinemetz wrote: > I am interested in creating a cgi perl script that I can publish on the > web that will tie into a mysql database and create a x,y axis graph > based on data selection. Any suggestions are greatly appreciated. Suggestio

Re: x,y axis graph

2011-02-15 Thread Jim Gibson
At 7:35 PM -0700 2/15/11, Chris Stinemetz wrote: I am interested in creating a cgi perl script that I can publish on the web that will tie into a mysql database and create a x,y axis graph based on data selection. Any suggestions are greatly appreciated. One method is to use gnuplot. Write

Re: x,y axis graph

2011-02-15 Thread shawn wilson
On Feb 15, 2011 9:36 PM, "Chris Stinemetz" < cstinem...@cricketcommunications.com> wrote: > > I am interested in creating a cgi perl script that I can publish on the web that will tie into a mysql database and create a x,y axis graph based on data selection. Any suggestions a

Re: x,y axis graph

2011-02-15 Thread Brian Fraser
On Tue, Feb 15, 2011 at 11:35 PM, Chris Stinemetz < cstinem...@cricketcommunications.com> wrote: > I am interested in creating a cgi perl script that I can publish on the web Cool. Any suggestions are greatly appreciated. > I think that maybe learning some Perl would be a solid first step. Bria

x,y axis graph

2011-02-15 Thread Chris Stinemetz
I am interested in creating a cgi perl script that I can publish on the web that will tie into a mysql database and create a x,y axis graph based on data selection. Any suggestions are greatly appreciated. Thank you, Chris Stinemetz

Re: Behavior of Regex modifier /x

2010-12-27 Thread Uri Guttman
>>>>> "SHC" == Shawn H Corey writes: SHC> On 10-12-27 07:11 PM, Uri Guttman wrote: >>>>>>> "SHC" == Shawn H Corey writes: SHC> On 10-12-27 06:30 PM, Uri Guttman wrote: >> >> yes, you have misunderstood it. w

Re: Behavior of Regex modifier /x

2010-12-27 Thread C.DeRykus
On Dec 27, 2:34 pm, paragka...@gmail.com (Parag Kalra) wrote: > Hi, > > I was under the impression that regex modifier '/x' ignores the white > space. So in following script both the if-else blocks should print > "Match" since the strings differ only in white

Re: Behavior of Regex modifier /x

2010-12-27 Thread Dr.Ruud
On 2010-12-27 23:34, Parag Kalra wrote: I was under the impression that regex modifier '/x' ignores the white space. So in following script both the if-else blocks should print "Match" since the strings differ only in white space and '/x' should ignore the w

Re: Behavior of Regex modifier /x

2010-12-27 Thread Mark
On Dec 27, 2:34 pm, paragka...@gmail.com (Parag Kalra) wrote: > I was under the impression that regex modifier '/x' ignores the white > space. It ignores white space in the regular expression, not in the text you are matching. For example, the following are equivalent: if

Re: Behavior of Regex modifier /x

2010-12-27 Thread Shawn H Corey
On 10-12-27 07:11 PM, Uri Guttman wrote: "SHC" == Shawn H Corey writes: SHC> On 10-12-27 06:30 PM, Uri Guttman wrote: >> yes, you have misunderstood it. where did you read or learn that /x >> ignores whitespace in the data? SHC> He probably

Re: Behavior of Regex modifier /x

2010-12-27 Thread Uri Guttman
>>>>> "SHC" == Shawn H Corey writes: SHC> On 10-12-27 06:30 PM, Uri Guttman wrote: >> yes, you have misunderstood it. where did you read or learn that /x >> ignores whitespace in the data? SHC> He probably got the idea since other non-alphanume

Re: Behavior of Regex modifier /x

2010-12-27 Thread Parag Kalra
Thanks All. With all these examples, now I see how /x works. Cheers, Parag On Mon, Dec 27, 2010 at 2:39 PM, Tim Mitchell wrote: > Try my $str = "HelloWorld"; > > On Mon, Dec 27, 2010 at 2:34 PM, Parag Kalra wrote: >> >> Hi, >> >> I was under the

Re: Behavior of Regex modifier /x

2010-12-27 Thread Shawn H Corey
On 10-12-27 06:30 PM, Uri Guttman wrote: yes, you have misunderstood it. where did you read or learn that /x ignores whitespace in the data? He probably got the idea since other non-alphanumeric characters in a variable must be escaped; un-escaped ones act like meta-characters. $ perl -e&#x

Re: Behavior of Regex modifier /x

2010-12-27 Thread Uri Guttman
>>>>> "PK" == Parag Kalra writes: PK> I was under the impression that regex modifier '/x' ignores the PK> white space. So in following script both the if-else blocks should PK> print "Match" since the strings differ only in white space

Behavior of Regex modifier /x

2010-12-27 Thread Parag Kalra
Hi, I was under the impression that regex modifier '/x' ignores the white space. So in following script both the if-else blocks should print "Match" since the strings differ only in white space and '/x' should ignore the white space. But looks like my underst

AW: :POP3 -- download only x number of mails

2009-12-13 Thread Thomas Bätzler
Agnello George asked: > I am planning to use the Net::POP3 module to downald a mail box and then > pass the mails via a parser . I would like to know if the there is a > option to downlod only a certin number ( 100 ) of mails [unread] > and then mark the mails as read . The mail box sie is 40

Net::POP3 -- download only x number of mails

2009-12-13 Thread Agnello George
Hi I am planning to use the Net::POP3 module to downald a mail box and then pass the mails via a parser . I would like to know if the there is a option to downlod only a certin number ( 100 ) of mails [unread] and then mark the mails as read . The mail box sie is 400 mb . And is there a way to

Re: Need help w/ substitute ie. s/x/y/

2009-07-06 Thread Dennis G. Wicks
Eric Veith wrote the following on 07/06/2009 04:35 AM: Dennis, Gunnar is right, you're misusing character classes. A correct regular expression could look like this (using /x and Perl 5.10's named capture buffers): /(?]+>) (?]+>) \s, (?]+>]+>) (?[^<]+) /x I did n

Re: Need help w/ substitute ie. s/x/y/

2009-07-06 Thread Eric Veith
Dennis, Gunnar is right, you're misusing character classes. A correct regular expression could look like this (using /x and Perl 5.10's named capture buffers): /(?]+>) (?]+>) \s, (?]+>]+>) (?[^<]+) /x I did not test that, but I guess you'll get the meaning.

Re: Need help w/ substitute ie. s/x/y/

2009-07-03 Thread Dennis G. Wicks
Gunnar Hjalmarsson wrote the following on 07/03/2009 07:34 PM: Dennis G. Wicks wrote: Greetings; I have a file of 100+ records like the following. I hope the line wrap doesn't mess things up too much. http://www.ten.com/"; target="_blank">|border="0">| ,http://www.ten.com/"; target="_blank">

Re: Need help w/ substitute ie. s/x/y/

2009-07-03 Thread Gunnar Hjalmarsson
Dennis G. Wicks wrote: Greetings; I have a file of 100+ records like the following. I hope the line wrap doesn't mess things up too much. http://www.ten.com/"; target="_blank">|border="0">| ,http://www.ten.com/"; target="_blank">size="1">|Link Text Message| <-($1)

Need help w/ substitute ie. s/x/y/

2009-07-03 Thread Dennis G. Wicks
Greetings; I have a file of 100+ records like the following. I hope the line wrap doesn't mess things up too much. http://www.ten.com/"; target="_blank">|| ,http://www.ten.com/"; target="_blank">|Link Text Message| <-($1)--->|<-($2)

Re: Error: Can't call method "x" without a package or object reference...

2009-03-23 Thread M. Coiffure
Original-Nachricht > Datum: Mon, 16 Mar 2009 12:41:01 -0400 > Von: "Chas. Owens" > An: Jim Gibson > CC: beginners@perl.org > Betreff: Re: Error: Can\'t call method "x" without a package or object > reference... > On

Re: Error: Can't call method "x" without a package or object reference...

2009-03-16 Thread Chas. Owens
On Mon, Mar 16, 2009 at 12:23, Jim Gibson wrote: snip >> Can't call method "x" without a package or object reference at test.pl line >> 12 >> line 1 snip >> $ent{$1} = \x{$2}; snip > Without seeing all of your data, it is impossible to tell what act

Re: Error: Can't call method "x" without a package or object reference...

2009-03-16 Thread Jim Gibson
On 3/14/09 Sat Mar 14, 2009 5:28 AM, "M. Coiffure" scribbled: > Hi all > > I'm getting this error on the following (test) script: > > Can't call method "x" without a package or object reference at test.pl line 12 > line 1 > > What I w

Re: Error: Can't call method "x" without a package or object reference...

2009-03-14 Thread Chas. Owens
On Sat, Mar 14, 2009 at 08:28, M. Coiffure wrote: > Hi all > > I'm getting this error on the following (test) script: > > Can't call method "x" without a package or object reference at test.pl line > 12 line 1 snip >        $ent{$1} = \x{$2}; snip The \

Error: Can't call method "x" without a package or object reference...

2009-03-14 Thread M. Coiffure
Hi all I'm getting this error on the following (test) script: Can't call method "x" without a package or object reference at test.pl line 12 line 1 What I want to do is create a HashMap where the keys are names of accented characters (as they are used in entities) an

Re: GD::Graph::bars - multiple x-axis data sets

2009-01-15 Thread Danny Miller
ure how >> to do this. >> >> My code looks like: >> >> @xdata1; # bunch of x values >> @ydata1; # bunch of corresponding y values >> >> @xdata2; # second set of x values I'd like to plot >> @ydata2; # second set of y values > > > I have

Re: GD::Graph::bars - multiple x-axis data sets

2009-01-15 Thread Raymond Wan
Hi Danny, Danny Miller wrote: Hi, I've got two sets of data I'm displaying in a bar graph. I'd like to use two different colors for the different data. I'm not sure how to do this. My code looks like: @xdata1; # bunch of x values @ydata1; # bunch of correspondi

GD::Graph::bars - multiple x-axis data sets

2009-01-14 Thread Danny Miller
Hi, I've got two sets of data I'm displaying in a bar graph. I'd like to use two different colors for the different data. I'm not sure how to do this. My code looks like: @xdata1; # bunch of x values @ydata1; # bunch of corresponding y values @xdata2; # second set of x val

Re: Delete file if it contains x y or z

2008-09-07 Thread Peter Scott
On Sat, 06 Sep 2008 16:01:08 +0100, brian54321uk wrote: > Just tried this, nothing happened at all. Really. $ echo abc > /tmp/bar/one $ echo xyz > /tmp/bar/two $ echo ab..yz > /tmp/bar/three $ ls /tmp/bar one three two $ cat /tmp/foo #!/usr/bin/perl use strict; use warnings; sub delete_contain

Re: Delete file if it contains x y or z

2008-09-06 Thread asmith9983
Here's another way, but not necessarily the best Perl, but it does work: #!/usr/bin/env perl use strict; use warnings; my @filelist=; chomp @filelist; my $match_strings=qr '(abc123blue|xyz357green)'; my ($file, ); foreach $file (@filelist) { #print "file=$file\n"; open(FD,"<$file") or die "Cann

Re: Delete file if it contains x y or z

2008-09-06 Thread brian54321uk
[EMAIL PROTECTED] wrote: Here's another way, but not necessarily the best Perl, but it does work: #!/usr/bin/env perl use strict; use warnings; my @filelist=; chomp @filelist; my $match_strings=qr '(abc123blue|xyz357green)'; my ($file, ); foreach $file (@filelist) { #print "file=$file\n"; Is

Re: Delete file if it contains x y or z

2008-09-06 Thread brian54321uk
Peter Scott wrote: On Fri, 05 Sep 2008 19:09:25 +0100, brian54321uk wrote: I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the best way of achieving this please? One way: use strict; use warnings; s

Re: Delete file if it contains x y or z

2008-09-06 Thread Peter Scott
On Fri, 05 Sep 2008 19:09:25 +0100, brian54321uk wrote: > I would like to test a folder full of files, and if a file contains > abc123blue or xyz357green then that file is to be deleted. > What would be the best way of achieving this please? One way: use strict; use warnings; sub delete_contain

Re: Delete file if it contains x y or z

2008-09-06 Thread brian54321uk
Aruna Goke wrote: brian54321uk wrote: Aruna Goke wrote: Mr. Shawn H. Corey wrote: On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote: HI again I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the

Re: Delete file if it contains x y or z

2008-09-06 Thread brian54321uk
John W. Krahn wrote: Dr.Ruud wrote: brian54321uk schreef: I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the best way of achieving this please? I would use `grep -l` to get the list of filenames, an

Re: Delete file if it contains x y or z

2008-09-06 Thread brian54321uk
John W. Krahn wrote: Aruna Goke wrote: brian54321uk wrote: Aruna Goke wrote: Mr. Shawn H. Corey wrote: On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote: HI again I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be delete

Re: Delete file if it contains x y or z

2008-09-06 Thread John W. Krahn
Aruna Goke wrote: brian54321uk wrote: Aruna Goke wrote: Mr. Shawn H. Corey wrote: On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote: HI again I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the

Re: Delete file if it contains x y or z

2008-09-06 Thread John W. Krahn
Dr.Ruud wrote: brian54321uk schreef: I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the best way of achieving this please? I would use `grep -l` to get the list of filenames, and rm to unlink them. N

Re: Delete file if it contains x y or z

2008-09-06 Thread Dr.Ruud
brian54321uk schreef: > I would like to test a folder full of files, and if a file contains > abc123blue or xyz357green then that file is to be deleted. > What would be the best way of achieving this please? I would use `grep -l` to get the list of filenames, and rm to unlink them. No Perl involv

Re: Delete file if it contains x y or z

2008-09-06 Thread Aruna Goke
brian54321uk wrote: Aruna Goke wrote: Mr. Shawn H. Corey wrote: On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote: HI again I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the best way of achievi

Re: Delete file if it contains x y or z

2008-09-05 Thread Aruna Goke
Mr. Shawn H. Corey wrote: On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote: HI again I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the best way of achieving this please? If however, it would be

Re: Delete file if it contains x y or z

2008-09-05 Thread Jeff Pang
2008/9/6 Raja Vadlamudi <[EMAIL PROTECTED]>: > > for (glob("folder/*")) { > unlink if m/abc123blue|xyz357green/; > } > This would also delete "abc123blue.exe", "abc123blue.txt", "otherabc123blue" etc. OP could consider to use File::Find to do that. -- Regards, Jeff. -- To unsubscribe, e-mai

Re: Delete file if it contains x y or z

2008-09-05 Thread Mr. Shawn H. Corey
On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote: > HI again > I would like to test a folder full of files, and if a file contains > abc123blue or xyz357green then that file is to be deleted. > What would be the best way of achieving this please? > > If however, it would be simpler for the s

Re: Delete file if it contains x y or z

2008-09-05 Thread Raja Vadlamudi
On Fri, Sep 5, 2008 at 2:09 PM, brian54321uk <[EMAIL PROTECTED]>wrote: > HI again > I would like to test a folder full of files, and if a file contains > abc123blue or xyz357green then that file is to be deleted. > What would be the best way of achieving this please? > > If however, it would be si

Delete file if it contains x y or z

2008-09-05 Thread brian54321uk
HI again I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the best way of achieving this please? If however, it would be simpler for the script to empty the files contents, that's not a problem as I hav

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: Rob Dixon wrote: returns the number of colons found but leaves them untouched. Similarly $str =? tr/\t /_/; this is great!! use warnings; use strict; my $str = 'ab:cd:ef:g:hi::now;'; print $str =~ tr/:// . "\n"; print $str =~ tr/:b/_X/ . "\n"; p

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread John W. Krahn
Richard Lee wrote: Rob Dixon wrote: returns the number of colons found but leaves them untouched. Similarly $str =? tr/\t /_/; this is great!! use warnings; use strict; my $str = 'ab:cd:ef:g:hi::now;'; print $str =~ tr/:// . "\n"; print $str =~ tr/:b/_X/ . "\n"; print "$str\n"; ././.

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread Richard Lee
Rob Dixon wrote: Richard Lee wrote: John W. Krahn wrote: Richard Lee wrote: Can you please tell me how to shorten this? my @an = split(//); my @num = grep { $_ eq ':' } @an ; I was trying to see how many : occur in variable but didn't know how to do it fast so i did it like

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread Rob Dixon
Richard Lee wrote: > > John W. Krahn wrote: > >> Richard Lee wrote: >> >>> Can you please tell me how to shorten this? >>> >>> my @an = split(//); >>> my @num = grep { $_ eq ':' } @an ; >>> >>> I was trying to see how many : occur in variable but didn't know how >>> to do it fast so i did it like

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: Can you please tell me how to shorten this? my @an = split(//); my @num = grep { $_ eq ':' } @an ; I was trying to see how many : occur in variable but didn't know how to do it fast so i did it like above... I would like to see as many way different w

Re: how to shorten this code ? x occur how many times in variable

2008-05-06 Thread John W. Krahn
Richard Lee wrote: Can you please tell me how to shorten this? my @an = split(//); my @num = grep { $_ eq ':' } @an ; I was trying to see how many : occur in variable but didn't know how to do it fast so i did it like above... I would like to see as many way different ways to get this done i

how to shorten this code ? x occur how many times in variable

2008-05-06 Thread Richard Lee
Can you please tell me how to shorten this? my @an = split(//); my @num = grep { $_ eq ':' } @an ; I was trying to see how many : occur in variable but didn't know how to do it fast so i did it like above... I would like to see as many way different ways to get this done if possible thank yo

Re: Best way to grab lines n thru x of a file

2008-04-11 Thread Randal L. Schwartz
> ""Jonathan" == "Jonathan Mast" <[EMAIL PROTECTED]> writes: "Jonathan> The line numbers are 4million to 4million + some odd hundred thousand, just "Jonathan> to give an idea of the size. Sounds like you want a database, not a flat file. Time to migrate. -- Randal L. Schwartz - Stonehenge

Re: Best way to grab lines n thru x of a file

2008-04-11 Thread Peter Scott
On Thu, 10 Apr 2008 16:35:14 -0400, Jonathan Mast wrote: > perl -ne 'print if 20 .. 50' file looks perfect but I totally don't > understand it perldoc perlop: In scalar context, ".." returns a boolean value. The operator is bistable, like a flip-flop, and emulates the line-rang

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread yitzle
On Thu, Apr 10, 2008 at 4:35 PM, Jonathan Mast <[EMAIL PROTECTED]> wrote: > Thanks for all the input. > > The head / tail solution would work, but isn't very scalable. I did > something similar on another file of comparable size and it took a long time > to complete. > > The line numbers are 4

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread Jonathan Mast
Thanks for all the input. The head / tail solution would work, but isn't very scalable. I did something similar on another file of comparable size and it took a long time to complete. The line numbers are 4million to 4million + some odd hundred thousand, just to give an idea of the size. The se

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread yitzle
or use sed! To print lines 5 through 10: sed -ne '5,10p' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread John W. Krahn
Chas. Owens wrote: On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast <[EMAIL PROTECTED]> wrote: Hi, I have a ~125MB file of which I want to read lines n thru n+x and write those into a separate file. What is the best way to go about this? Use the flip-flop operator* (..): perl -ne &#x

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread John W. Krahn
Jonathan Mast wrote: Hi, Hello, I have a ~125MB file of which I want to read lines n thru n+x and write those into a separate file. What is the best way to go about this? while ( ) { # read and ignore up to n last if $. == $n - 1; } while ( ) { print; last if

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread Jialin Li
or use head and tail command head -n50 file | tail -n30 On Thu, Apr 10, 2008 at 11:54 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast > <[EMAIL PROTECTED]> wrote: > > Hi, I have a ~125MB file of which I want to read line

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread Chas. Owens
On Thu, Apr 10, 2008 at 12:24 PM, Jonathan Mast <[EMAIL PROTECTED]> wrote: > Hi, I have a ~125MB file of which I want to read lines n thru n+x and write > those into a separate file. What is the best way to go about this? > > thanks > Use the flip-flop operator* (..)

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread Mathew
I think a simpler solution would be to use head and tail: head -n x > file.txt tail -n x-n file.txt > file2.txt Xavier Noria wrote: On Apr 10, 2008, at 18:24 , Jonathan Mast wrote: Hi, I have a ~125MB file of which I want to read lines n thru n+x and write those into a separate file.

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread Xavier Noria
On Apr 10, 2008, at 18:24 , Jonathan Mast wrote: Hi, I have a ~125MB file of which I want to read lines n thru n+x and write those into a separate file. What is the best way to go about this? Tie::File -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Best way to grab lines n thru x of a file

2008-04-10 Thread Jonathan Mast
Hi, I have a ~125MB file of which I want to read lines n thru n+x and write those into a separate file. What is the best way to go about this? thanks

RE: parse x.500 DN and change order displayed

2008-03-31 Thread peter
> Peter Scott <[EMAIL PROTECTED]> wrote: >> On Sun, 30 Mar 2008 20:36:58 -0700, SecureIT wrote: >> > I am trying to change this >> > >> > "cn=Bob Smith+serialNumber=CR013120080827,o=ICM,c=US" >> > >> > to this: >> > >> > "serialNumber=CR013120080827+cn=Bob Smith,o=ICM,c=US" > >>s/^(cn=.*?)+(.*?

RE: parse x.500 DN and change order displayed

2008-03-31 Thread Thomas Bätzler
Peter Scott <[EMAIL PROTECTED]> wrote: > On Sun, 30 Mar 2008 20:36:58 -0700, SecureIT wrote: > > I am trying to change this > > > > "cn=Bob Smith+serialNumber=CR013120080827,o=ICM,c=US" > > > > to this: > > > > "serialNumber=CR013120080827+cn=Bob Smith,o=ICM,c=US" >s/^(cn=.*?)+(.*?),/$2+$

  1   2   3   4   >