Re: Modify excel worrkbook in perl

2010-04-26 Thread luke devon
functions which are exclude in the Spreadsheet::ParseExcel. Like delete sheet , delete row, adding data ...etc. For that task , do we need to call Spreadsheet::WriteExcel package? Can somebody help me on this please? Many Thanks Luke From: Shlomi Fis

Modify excel worrkbook in perl

2010-04-25 Thread luke devon
erl module that we can use ? Thanks in Advance Luke

Re: delete 20 000 records in oracle from perl

2009-08-17 Thread luke devon
Hi Since i have more binary data to be deleted in the requested query , i have to use a external script/program to satisfy the deletion. So thats why i wanted to know , how can we implement multi threading for the situation. Thanks Luke From: Raymond Wan

Re: delete 20 000 records in oracle from perl

2009-08-16 Thread luke devon
Hi Ray Thanks for the reply . Yes , when we going to delete those records , CPU is going high.So then its effecting to the performance. as i beginner in perl , how can i implement multi-threaded env ? Can you help me further ? Thanks & Regards Luke

delete 20 000 records in oracle from perl

2009-08-16 Thread luke devon
errors via die( ) } ); ### Prepare a SQL statement for execution $sth = $dbh->prepare( "DELETE rec1,rec2 * FROM TB1" ); ### Execute the statement in the database $sth->execute( ); } ### Disconnect from the database $dbh->disconnect(

Use of uninitialized value in concatenation (.) or string

2008-07-25 Thread luke devon
##', '##', '##', 0)"; $sql_x = "DELETE FROM Table WHERE # = '" . $# . "' AND # = '" . $## . "' AND # = '" . $ . "'" ; my $dbh = DBI->connect("dbi:mysql:DB;localhost","###","") || die "Error Opening DataBase: $DBI::errstr\n"; if ( $###=~m#XXX# ){ $dbh->do($sql_x); }else{ $dbh->do ($sql); } if ($dbh->err()) { die "sql error $DBI::errstr\n"; } $dbh->disconnect(); Many Thanks Luke Send instant messages to your online friends http://uk.messenger.yahoo.com

Re: Perl script doesnt behave well

2008-07-20 Thread luke devon
. $#; } else { $url .= "?#=" . $# . "-" . $### . "-" . $#####; } print $url."\n"; } else { print "\n"; } } }else { print "\n"; } my $sth->finish();

Re: Perl script doesnt behave well

2008-07-14 Thread luke devon
s. as you know , does mysql switch to a idle mode or sleep mode , coz just for testing i don't send many request at a time. just a single test request made for the servers. Thank you Luke - Original Message From: Rob Dixon <[EMAIL PROTECTED]> To: Perl Cc: luke devon <

Re: Perl script doesnt behave well

2008-07-14 Thread luke devon
could you please direct me how could I implement those steps in to the code ? - Original Message From: Thomas Bätzler <[EMAIL PROTECTED]> To: Perl Cc: luke devon <[EMAIL PROTECTED]> Sent: Monday, July 14, 2008 16:05:21 Subject: RE: Perl script doesnt behave well luke d

Perl script doesnt behave well

2008-07-14 Thread luke devon
} print $url."\n"; } else { print "\n"; } } }else { print "\n"; } $sth->finish(); $dbh->commit(); $dbh->disconnect(); Many thanks Luke Send instant messages to your online friends http://uk.messenger.yahoo.com

Re: Filtering contetn in a variable

2008-07-10 Thread luke devon
g Sent: Wednesday, July 9, 2008 20:33:45 Subject: Re: Filtering contetn in a variable [ Please stop top-posting!!! ] luke devon wrote: > Li, Jialin wrote: >> luke devon wrote: >>> I am storing IP in to a varable , $ip="172.22.8.10 \-"; >>> but i wanted to

Re: Filtering contetn in a variable

2008-07-09 Thread luke devon
Thnks for the reply,   I am receiving IP value as 192.168.10.5/ -   From here , i wanted to filtered out the exact ip. i tried your example , but it didnt work. please help - Original Message From: yitzle <[EMAIL PROTECTED]> To: luke devon <[EMAIL PROTECTED]> Cc: Perl Sen

Re: Filtering contetn in a variable

2008-07-09 Thread luke devon
Thnks for the reply, I am receiving IP value as 192.168.10.5/ - From here , i wanted to filtered out the exact ip. i tried your example , but it didnt work. please help - Original Message From: "Li, Jialin" <[EMAIL PROTECTED]> To: luke devon <[EMAIL PROTECT

Re: Filtering contetn in a variable

2008-07-09 Thread luke devon
Thnks for the reply, I am receiving IP value as 192.168.10.5/ - From here , i wanted to filtered out the exact ip. i tried your example , but it didnt work. please help - Original Message From: "Li, Jialin" <[EMAIL PROTECTED]> To: luke devon <[EMAIL PROTECT

Filtering contetn in a variable

2008-07-09 Thread luke devon
Hi I am storing IP in to a varable ,  $ip="172.22.8.10 \-"; but i wanted to filter out only the ip . how can i do that ? please help Thank you Luke Send instant messages to your online friends http://uk.messenger.yahoo.com

closing dbh with active statement handles

2008-07-08 Thread luke devon
$url .= ("&valueB=" . $VALUEB); } else { $url .= ("?valueB=" . $VALUEB); } print $url."\n"; } else { print "\n"; } } $sth->finish(); $dbh->commit(); $dbh->disconnect(); Many Thanks Luke. Send instant messages to your online friends http://uk.messenger.yahoo.com

Define NULL value in Perl

2008-07-08 Thread luke devon
Hi How can we define NULL values in perl ? for instance if I wanted to assign a NULL value for a variable called "$x= , how would it be in the code ? Thank you Luke Send instant messages to your online friends http://uk.messenger.yahoo.com

mysql data store in to a FILE

2008-07-03 Thread luke devon
thanks Luke Send instant messages to your online friends http://uk.messenger.yahoo.com

Re: Problem with Arrays

2008-06-23 Thread luke devon
iables have not been declared. You need to declare the @array and $temp as my @array, my $temp. Also, the second element of @array is $array[1] not @array[1]. Mimi On 23/06/2008, luke devon <[EMAIL PROTECTED]> wrote: > > Hi , > > I tried to capture some data in STDIN and wante

Problem with Arrays

2008-06-23 Thread luke devon
[EMAIL PROTECTED]; print; }else { print; } } $dbh->commit(); $dbh->disconnect(); } Could you please help me to solve this problem , what are those scalar errors in the code ? please help me Thank you Luke Send instant messages to your online friends http://uk.messenger.yahoo.com

Filtered out a IP in a URL

2008-06-18 Thread luke devon
Dear Friends, In squid URL-rewriting , I wanted to add some third party parameters to the URL and wanted to filtered out IP which assigned for client ( Client -IP ). Rather than having a shell script , I supposed to do a perl script for that purpose . But it seems bit tricky, How can I do this ?

Re: Capture URL parameter

2008-06-17 Thread luke devon
Could you please help me ? Thank you Luke. - Original Message From: Octavian Rasnita <[EMAIL PROTECTED]> To: luke devon <[EMAIL PROTECTED]>; Perl Sent: Tuesday, June 17, 2008 14:32:34 Subject: Re: Capture URL parameter From: "luke devon" <[EMAIL PROTECTED]

Capture URL parameter

2008-06-17 Thread luke devon
Luke Send instant messages to your online friends http://uk.messenger.yahoo.com

database insert algorithm

2007-09-22 Thread Luke
it... Maybe create hash with part of data (maybe all of it - what are the limitations ?) What is other way to do it instead 'INSERT INTO...' statement after reading each line ? Thanks for any help in advance... Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

Re: parse / log analysis help

2007-08-01 Thread Luke
On Aug 1, 2:48 pm, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > # Looks like the file is small so simply treating it as a single > string is > # likely to be the simplest approach. > > # In reality you'd need to slurp the file in a Unicode-aware way Wow, thanks a million !

Re: perl IDE

2007-08-01 Thread Luke
On Jul 28, 9:55 pm, [EMAIL PROTECTED] (Tony Heal) wrote: > I am looking for a good IDE for perl, I have eclipse and one of it's plugins, > but I am wondering if I a spinning my > wheels trying to set this up when there may be a better alternative. > > Tony Heal ActiveState Komodo - it is the best

parse / log analysis help

2007-08-01 Thread Luke
Hello all, I am new to perl. I am trying to analyze and insert do database some data from bunch of weird unicode log files. I did manage to complete Unicode and database part but now log analysis - thats the area where I need some help... Log file has following structure: ***

Perl proxy - adding user defined HEADERS

2006-11-10 Thread luke devon
would be possible it with perl ? your ideas and comments highly appreciate . even If you cud send me some helpful url it would be a help . Thank you, Luke. Send instant messages to your online friends http://uk.messenger.yahoo.com

Fwd: WAP development from perl

2006-08-29 Thread luke devon
such stuff from perl ?your advices and ideas are welcome Thank you,Luke. Send instant messages to your online friends http://uk.messenger.yahoo.com --- End Message --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/>

WAP development from perl

2006-08-26 Thread luke devon
catagories , one is wml and other one is xhtml , from xhtml we can display some fancy stuff . so , how can we displayed such stuff from perl ? your advices and ideas are welcome Thank you, Luke. Send instant messages to your online friends http://uk.messenger.yahoo.com

Re: Determining Reference Type

2006-06-02 Thread Luke Bakken
I, ahem, did some more digging and found that the great Perl gods have already thunk this one through and provided the ref() operator. It returns the reference type just as I need. Thanks for letting me think this out on the list. You should also look at the Scalar::Util module. -- To uns

Re: Perl script to search and replace a string in a file

2006-06-02 Thread Luke Bakken
>> > perl -pi -e 's/original text/new text/g' * >> >> Error: Can't do inplace edit without backup. > > You need either perl -pi.bak -e ... or an OS upgrade. Windows, > unfortunately, can't manage this. This isn't a Windows problem, this is a Perl on Windows problem that is solely in the Perl i

Add values into Tunnel stream

2006-05-20 Thread luke devon
ase pick a value and that also has to be parse into the tunnel stream . This is what i wanted to do , can somebody help me please ? I'm really appreciate your help and any guidenece . Thanx in advance, Luke. Send instant messages to your online friends http://uk.messenger.yahoo.com

Re: Better way to add one line at top of every file(one liner)

2006-05-19 Thread Luke Bakken
On 5/19/06, David Romano <[EMAIL PROTECTED]> wrote: Hi Ankur, On 5/18/06, Ankur Gupta wrote: > perl -0777 -p -i -e 'print "abcdefgh\n"' *.ext > or > perl -0777 -p -i -e 's#^#abcdefgh\n#' *.ext > or > ??? I did this: perl -p -i -e '$_ = ($ARGV ne $f && $f = $ARGV) ? "NEW FIRST LINE\n$_" : $_' *.e

Win32::OLE, ADODB.Stream and ADODB.Command problem.

2006-03-07 Thread Luke Bakken
-- I believe the following line is not assigning the $sResponseStream object to the "Output stream" property: $cmCmd->{'Properties'}->{'Output stream'}->{'Value'} = $sResponseStream; If I check the value of

RE: bug or am I not understanding?

2006-02-22 Thread Luke, David
e standard end of line marker for Unix systems, so a Unix "\n" can appear to work with Windows data in many cases. Depending upon the OS your Perl script is running under, $a = index($state, "/\n"); will match Hex 2F 0A or Hex 2F 0D 0A. David Luke, Systems Project Anal

Re: Need to login to a site and get data

2006-02-08 Thread Luke Bakken
> Thanks for the input. One thing I forgot to mention was that the site > uses javascript which caused me to turn to perl as lynx does not support > it. You will have to determine manually how the website uses javascript and code LWP::UserAgent appropriately to send the correct information in the

Re: Need to login to a site and get data

2006-02-08 Thread Luke Bakken
> I want to login to a site through scripts and retreive data. I was doing > it till now through expect and lynx text browser's ability to record a > session and run the commands. > > I think it's possible through perl and it's numerous modules. Can anyone > point me as to how it may be done. LWP:

RE: Script's command-line options under Windows

2006-02-02 Thread Bakken, Luke
C:\>assoc .pl .pl=Perl C:\>ftype Perl Perl=c:\perl\bin\perl.exe "%1" %* Also, you can add .PL to the PATHEXT variable if you don't want to have to use the extension to run the script in the future. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

RE: File Parsing

2006-01-24 Thread Bakken, Luke
William Black wrote: > Hello, > > I'm reading from a file. I'm trying to read in five lines at a time > where each line has a newline and then process the lines into > separare variables. For example, > > Input File > - > Stevens, > Craig A Triangle Family Care PA > 106-A Ridgeview D

RE: CSV Help

2005-12-22 Thread Luke, David
Excel format, you may need to install a module from CPAN: http://search.cpan.org/search?query=spreadsheet&mode=all David Luke, Application Developer IV ISOCORP, Inc. DMS Enterprise Information Technology Services Building 4030, Suite 115 4050 Esplanade Way Tallahassee, Florida 32399-0950

RE: Equal length ID numbers

2005-12-15 Thread Bakken, Luke
Andrej Kastrin wrote: > Hi all, > > Suppose that we have numbers 1 to 1000 and we want all numbers be > equal lengh; e.g.: > 0001 > 0002 > 0003 > ... > .. > 1000 > > Any ideaa on how to fix this problem? > > Best, Andrej perldoc -f sprintf -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

RE: Windows XP Pro vs Windows 2000

2005-11-10 Thread Bakken, Luke
Thanks, > Walt Poor This could be a problem with the permissions of the parent folder to the ones you are moving from and creating. Does it propagate the permissions properly? Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Win32::OLE, ADODB.Stream and ADODB.Command problem.

2005-10-11 Thread Luke Bakken
-- I believe the following line is not assigning the $sResponseStream object to the "Output stream" property: $cmCmd->{'Properties'}->{'Output stream'}->{'Value'} = $sResponseStream; If I check the value of the "Output stream" property after the assignment with Win32::OLE->QueryObjectType() it indicates that it is not a valid Win32::OLE object. Am I doing the assignment incorrectly? I can't imagine this being a limitation of Win32::OLE. Thanks, Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

RE: Missing objects in Database

2005-10-05 Thread Bakken, Luke
Ryan Frantz wrote: > But that does not work. Then I saw that for non-SELECT statements > (which I assume an EXEC is not; I'm new to DBs), that it will return > "OEO" if nothing was affected. I think, though, that this refers more > to INSERT and its ilk. > > Should I set RaiseError to 1? > >

RE: sort with special order

2005-10-03 Thread Bakken, Luke
JupiterHost.Net wrote: >> On Oct 3, JupiterHost.Net said: >> >>> I have a list of strings that start with an uppercase B, Q, or Z >>> >>> I need to sort them so they are in order of Q, B , then Z >>> >>> Any ideas or input on how to efficiently do that with sort() or even >>> map() is most appre

RE: Date in perl

2005-09-29 Thread Bakken, Luke
Tom Allison wrote: > Gomez, Juan wrote: >> I have a problem need to work with date >> >> I have a input like these : 20050829 and I need to change it to >> something like this : Aug 29 2005 >> >> but it still eludes me how to do that >> >> can anyone help me please? >> > I was going to say "

RE: Splitting on =

2005-09-21 Thread Bakken, Luke
Tommy Nordgren wrote: > How do you split a string on the equality character? > Neither split (/=/,$myvar) > nor split ('=',$myvar) > appears to work > "Home is not where you are born, but where your heart finds peace" - > Tommy Nordgren, "The dying old crone" You are doing something incorrectly.

RE: module and a class?????

2005-09-15 Thread Bakken, Luke
Jabir Ahmed wrote: > hello > can anyone tell me the basic difference between a > module and a class in perl. > > i would be glad if you could give a brief example.; > > thanks > > jabir perldoc perlboot -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

RE: Please Help!!! Newbie Question

2005-09-01 Thread Bakken, Luke
Perl wrote: > Hi List, > > I have this script which actually returns the value of the filename > with extension but If the file name is something like > "c:\projects\text 009.txt" (having a space in filename which is > common in windows). > This script only returns "text" instead of returning ful

RE: Please Help!!! Newbie question

2005-08-31 Thread Bakken, Luke
Perl wrote: > I am new to perl so I need some help from the list with this script. > It takes a value from command line and then returns afters processing. > For example, If value is "c:\projects\test 2005.txt" the script will > returns it as "test" (actually omitts any space in the directory or >

RE: Win32::OLE question(s)

2005-08-31 Thread Bakken, Luke
Bakken, Luke wrote: > Tim wrote: >> Hello. >> >> The following code produces the output below. The first column should >> be a date. This happens whether the "valof" function is used or not. >> Anyone have any Variant tricks? >> >> Than

RE: Win32::OLE question(s)

2005-08-31 Thread Bakken, Luke
Tim wrote: > Hello. > > The following code produces the output below. The first column should > be a date. This happens whether the "valof" function is used or not. > Anyone have any Variant tricks? > > Thanks. > Tim Read up on the Range property and Cells property. http://msdn.microsoft.com/li

RE: Date in perl

2005-08-27 Thread Bakken, Luke
Hi all I have a problem need to work with date I have a input like these : 20050829 and I need to change it to something like this : Aug 29 2005 but it still eludes me how to do that can anyone help me please? --- I normally don't just give ou

RE: route STDOUT to file

2005-06-27 Thread Bakken, Luke
Manish Sapariya wrote: > I use screen as my tool to deal with unstable network connection. > Its command line version of vncviewer. > > Screen dameon allows me to reconnect the previously opened screen, > if I by mistake detache or exit the current shell, or network forces > my connection down. H

RE: change char, keep case

2005-06-20 Thread Luke, David
econd) : uc($second);   # If $second is NOT uppercase, force $first lowercase, else force $first uppercase $second = (ord(uc($second))-ord($second)) ? lc($first) : uc($first);     $first = $temp;   print $first, "\n"; print $second, "\n";     David Luke, Application Develope

RE: Best practice when using data from external files

2005-06-14 Thread Bakken, Luke
>>> Just one thing though - I need to have DBD::SQLite installed on my >>> server and it's not on there, nor will it be (again, not my choice). >>> I'm still up a certain creek without a paddle *grin* >> >> Well, that one is between you and your admins, but Perl development >> is *significantly* e

RE: remove duplicate lines (OT)

2005-05-27 Thread Bakken, Luke
> $ cat marc21textfile | uniq > outputfile Where's Randal for a UUOC award? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Spreadsheet::ParseExcel - Out of memory error

2005-04-27 Thread Bakken, Luke
> my $oBook; > my $oWks; > foreach $hashEntry ( @LOGS ) > { > > my ( $localfile)= $hashEntry->{name}; > my ( $err_msg ) = ""; # error message > variable > > > my $cmd = ""; > > # > # Get row count of each fi

RE: Edit Windows PATH

2005-04-27 Thread Bakken, Luke
Chris Devers wrote: > On Fri, 1 Jan 1988, amr wrote: > >> Do we have Perl script that can edit & add to the Windows (XP, 2000) >> path.? > > Is there a reason that a simple system() command won't work here? > > my $status = system( "SET PATH=%PATH%;$new_path" ); > die "Couldn't set %PAT

RE: Send file to printer

2005-03-24 Thread Bakken, Luke
but I'll keep searching. > > Thanks for your help. > > -- begin c:\>net use lpt1: "\\hp-exch\HP LaserJet 4100(IS)" /p:n Then from the command line: c:\>copy file_for_printer lpt1: If that works, then using File::Copy to lpt1: should work as well. Luke -- To u

RE: Executing perl code on the command line

2005-03-11 Thread Bakken, Luke
> I am unable to execute a statement like -- perl -e '' -- > I always get this response: Can't find string terminator "'" > anywhere before > EOF at -e line 1. >From the command line, use " " to quote your code and qq() or q() as quotes inside your code: c:\>perl -e"print qq(Hello\n)" -- To

RE: setting program priority by PID

2005-03-03 Thread Bakken, Luke
> Hello, > > I'm on windows and I'd like to set program priority, if I know program > PID. It is possible ? Use Win32::Process: http://search.cpan.org/~jdb/libwin32-0.24/Process/Process.pm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Running an application from a perl service

2005-02-09 Thread Bakken, Luke
> I've written a Perl service which to help monitor an > application. On discovering an issue it is to bring up an > Internet explorer window with a link to a particular site. > Everything works perfectly, except that the Internet explorer > window is not visable! > The service starts Internet

RE: grabbing print output

2005-02-07 Thread Bakken, Luke
> open (PIPE, "|-", "convert -negate -modulate 200,0 -negate - > pbm:- | gocr -") or warn "$!\n"; > print PIPE $file; #file is image content > close PIPE; > > prints to STDOUT everything I need (it is one line, lets say "This is > test"). How I can grab this, so I have in > $var = "This is te

RE: hash slice/exists vs. grep benchmark weirdness...

2005-01-25 Thread Bakken, Luke
> > You have to stop spending so much time playing with all this bogus > > benchmarking :) > > It not bogus :) Its an example to find the best method for a project. > > If you prefer I'll ask the question I was trying to answer with the > benchmark: > > Assuming you have an array of 0-15 elemen

RE: perl script to binary executible

2005-01-24 Thread Bakken, Luke
> I would like to convert my perl script into a binary > executable before > deploying it on a client machine > > I checked on google and found "perlbin" at sourceforge.net but that > does not seem to work. It gives compilation error with handy.h file > which is the perl distribution file. >

RE: Counting occurences of a char in a line

2005-01-17 Thread Bakken, Luke
> Hi, > > I have the following code in a script I'm writing: > > foreach my $line () { > if ( 10 == ($line =~ s/,/,/g) ) { > print OUT $line; > } > } > > Is this poor style? It looks a bit ugly, but I can't figure out a > better way to do it. I'm sure there is :) > The script wil

RE: separating list alphabetically

2005-01-17 Thread Bakken, Luke
> I have some data that needs to be split up alphabetically into lists > that start with each letter of the alphabet. Sample data is like the > following with real URL data in place of URL1 and URL2. Only > the first > field is important for alphabetizing. If I do an array with > each lette

Copying a hash-of-hashes

2004-12-30 Thread Bakken, Luke
> Hello List, > To explain the problem I am having, I wrote a simple snipet > that doesn't do > anything meaningful other than illustrating the behaviour I > want to avoid: > > my %hoh = ( > 1 => { > a => 5, b => 5 > }, > > 2 => 5 >

RE: Can someone translate a small .PY to Perl?

2004-12-28 Thread Bakken, Luke
> > Or more commonly: > > > > while :; do > > ... > > done > > > > because the ":" command is true. > > It works for me. That's the way I'd seen it done when I was > learning bash. I > believe the while checks the return value, not the output of > the command.

RE: Need advanced help with tracking down warnings in eval'd functions

2004-12-09 Thread Bakken, Luke
> Perl already has a mechanism for splitting a large program in to > several smaller files. > > perldoc AutoLoader Or modules for that matter. When I first read the eval trickery my first thought was "WHY???". -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

RE: Should be a simple substitution?

2004-12-08 Thread Bakken, Luke
> > I think the ?: must be extraneous: > > That construct lets the regex engine know that it doesn't need to > worry about saving backreferences to the parenthesized group. It's on the right hand-side of the regex, however. Look at the output: C:\src\perl>perl -pe"s<{([^}]+)}><(?:@{[ ($a = $1) =

RE: Should be a simple substitution?

2004-12-08 Thread Bakken, Luke
> > $var =~ s<{([^}]+)}><(?:@{[ ($a = $1) =~ y/,/|/ && $a ]})>; > > > Does it not need the 'ge' at the end? > > I don't understand why you are creating an anonymous array > with a single > value, then dereferencing it... And what does the "?:" do? I think the ?: must be extraneous: C:\src

RE: Should be a simple substitution?

2004-12-08 Thread Bakken, Luke
> And is this method any faster or more efficient than this? > > $var =~ s/\{([^}]+)\}/$v = $1; $v =~ s!,!|!g; qq!($v)!/ge; Why not find out yourself? C:\src\perl>type rebench.plx use strict; use Benchmark qw/cmpthese/; sub luke { my $var = 'blargh{a,b,c}';

RE: Should be a simple substitution?

2004-12-06 Thread Bakken, Luke
> >> I can usually figure out regexes, and this one seems simple, but it > >> still eludes me-- > >> > >> I'm looking for a regex (or a couple of regexes) to do the > following: > >> > >> blahblah{ab,abcd}blah --> blahblah(ab|abcd)blah > >> blahblah{a,b,c}blah --> blahblah(a|b|c)blah >

RE: how the print the first 7 letter of file name

2004-10-22 Thread Bakken, Luke
> Subject: how the print the first 7 letter of file name > > Hi > > I have a problem > > I have > $FILENAME=C:\Developer\view_local\local_nt\FDAFDSAFDSASDFA\ASD FDAFSASDF\NewProcess_date_22-oct-2004.log > > How to get 'NewProcess only word > > kindly let me know > > Regards > Sreedhar Your

RE: executing 1 liners from cmd prompt

2004-10-20 Thread Bakken, Luke
> >You can't use "'" as delimiter on Windows. Try: > > > > perl -e "print \"test\n\"" > Or always use q() and qq() for one liners: perl -e"print qq(test\n)" -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: help - $line =~ tr/images\//..\/..\/images\//

2004-10-19 Thread Bakken, Luke
> >> > #!/usr/bin/perl > >> > ## set up for output to be sent to browser > >> > print "Content-type: text/html\n\n"; > >> > ## read in mp3store.html > >> > if (open (INFILE, "<../../mp3store.htm")) > >> > { > >> > foreach $line () > >> > { > >> > $line =~ tr/images\//..\/..\/images\// > >> > >>

RE: help - $line =~ tr/images\//..\/..\/images\//

2004-10-19 Thread Bakken, Luke
> > #!/usr/bin/perl > > ## set up for output to be sent to browser > > print "Content-type: text/html\n\n"; > > ## read in mp3store.html > > if (open (INFILE, "<../../mp3store.htm")) > > { > > foreach $line () > > { > > $line =~ tr/images\//..\/..\/images\// > > $line =~ s/images\//\.\.\/\.\.\

RE: help - $line =~ tr/images\//..\/..\/images\//

2004-10-19 Thread Bakken, Luke
> Hi all, > I wonder if someone can help me. What I want to do sounds so > simple but I > just cant crack it. > I am reading in an html page and i want to change 'images/' to > '../../images' but i am going round and round in circles. > my code so far is this: > > #!/usr/bin/perl > ## set up for

RE: How to reinvent grep with perl? (OT: Cygwin grep)

2004-10-10 Thread Bakken, Luke
> > Voila. That's most likely your problem - a mismatch between > line endings > > and Cygwin mount point type. > > And in case you hadn't seen them before... there are at least a few > sets of unix tools for dos/windows. Cygwin maybe the best known but > I've used Uwin myself for sometime and

RE: speed of grep{s///} vs ??? or am i asking the wrong question?

2004-10-05 Thread Bakken, Luke
> looks like readdir() is the all around winner :) Right, anytime you can avoid using system, qx, or `` you'll have a faster solution. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

RE: speed of grep{s///} vs ??? or am i asking the wrong question?

2004-10-04 Thread Bakken, Luke
> #!/usr/bin/perl > > > use strict; > use warnings; > > sub get_subdirectories{ > # retrieves list of directories from passed directory > # returns directory list as an array > > my $directory = shift; > open LS, "ls -l $directory|"; > local $/ = undef; >

RE: failure with: system("dir /b"); exec("dir /b"); `dir /b`

2004-09-17 Thread Bakken, Luke
ir is a built-in, you should do this: use strict; print qx!cmd /c dir /s!; print "\n-\n"; system('cmd /c dir /b'); print "\n-\n"; system("cmd /c dir /w"); print "\n-\n"; I do hope this is for testing, and that you won't be s

RE: how to encrypt my perl script

2004-08-16 Thread Bakken, Luke
Put a copyright notice in it and have a good lawyer. To: [EMAIL PROTECTED] Subject: **POSSIBLE SPAM**::how to encrypt my perl script Hello: I would run a perl script in my website which is hosted

RE: how do I handle filenames that have parens?

2004-08-13 Thread Bakken, Luke
; my $results = `$ct describe '$line' | $grep $label`; This should provide single quotes to the shell around the string in $line - I don't think you have to escape them here. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

RE: howto 'cat file|grep "foo bar"|wc -l' in perl

2004-07-30 Thread Bakken, Luke
> > Hello, > > > > I just started using perl and want to rewrite a simple bash > > script i've been > > using in the past to perl. > > > > I want to cat file|grep "foo bar"|wc -l and tried it the > > following way which > > worked for foobar as one word and not as two words. > > > > --- > > #!

RE: howto 'cat file|grep "foo bar"|wc -l' in perl

2004-07-30 Thread Bakken, Luke
> Hello, > > I just started using perl and want to rewrite a simple bash > script i've been > using in the past to perl. > > I want to cat file|grep "foo bar"|wc -l and tried it the > following way which > worked for foobar as one word and not as two words. > > --- > #!/usr/bin/perl > $logfile

RE: use lib - not known at compile time

2004-07-29 Thread Bakken, Luke
> I'm trying to add my own module "DEGS::ldegs" to a Perl program. > However, this module will part of a distribution called "RGSE", > which could be installed on a different path on different peoples PCs. > However, it will always be in the directory "$ENV{RGSE}/lib". > > The problem is when I ru

RE: Dates are killing me..

2004-07-07 Thread Bakken, Luke
> Hi Guys, > > I'm having a real hard time trying to figure this out.. > > There are tons of modules on dates, etc, but I can't seem to > find one to do > what I need. > > I have one date, for example: 2004-07-07. > > I need to take that date, get Monday's date and Sunday's date > where 2004

RE: multiple inheritance

2004-07-06 Thread Bakken, Luke
> > If so, in my > > constructor, how do I explicitly call the parent constructor? > >package Bar; > >@ISA = qw/Foo/; > >sub new { >my $class = shift; >bless Foo->new(@_), $class; >} Wouldn't you want this instead? package Bar; @ISA = qw/Foo/; sub new {

Copyright Violation -> RE: unique array

2004-07-02 Thread Bakken, Luke
> On Fri, 2 Jul 2004 14:32:49 -0400 , Bob Showalter wrote > > perl.org wrote: > > > From http://iis1.cps.unizar.es/Oreilly/perl/cookbook/ch04_07.htm, > > > > Methinks that stuff is illegally posted copyrighted information. > > Several people responded individually with comments like > this. If

RE: Find closest value

2004-05-17 Thread Bakken, Luke
Bob Showalter wrote: > Mike Blezien wrote: >> Hello, >> >> is it possible, with perl, to find the closest numerical value to a >> set value. IE. a set value of 15 and I have five values, >> 208,258,56,123 >> >> is there a function too go through the five values array to find the >> closest to 15

RE: Finding the current IP of my laptop

2004-04-22 Thread Bakken, Luke
> I would like to use a perl module instead of grep'ing the result of > ifconfig. > > Do you have so guidelines to give me ? > > Thanks in advance. Getting the IP is pretty platform dependent. If you're on Windows you can use Win32::IPHelper, but since you mentioned ifconfig I'm assuming you're

RE: "perl -i..." reminder?

2004-03-19 Thread Bakken, Luke
> Hello... > I need to add some boilerplate text to the very top of about > 17,000 files. I can get to the files easily enough (File::Find), but > there's a special syntax to edit a file in place, and it's > not specified > in Programming Perl, and it's a tough search on Google and > Perl

RE: Writing output of a Shell command directly to a file

2004-03-17 Thread Bakken, Luke
> Luke, > > Nope, this was the exact thing we were trying to get away > from. Suppose I > don't have space to store that file on the host box. We're > doing it in > stages now and I really want to get away from that since it > increases disk > activity

RE: Writing output of a Shell command directly to a file

2004-03-17 Thread Bakken, Luke
> @in = ssh("1.1.1.1", "tar cf - /home/$user | gzip") > open(TEMP, ">/tmp/$user.tar.gz") or die "Blargh!"; > print TEMP @in; > close(TEMP); Can you do this in stages? Create tar file: ssh("1.1.1.1", "tar cf - /home/$user | gzip -c | dd of=/tmp/foo.tgz") Use ftp or scp to get it to your backup ma

RE: Pattern matching problem

2004-02-25 Thread Bakken, Luke
> I'm having trouble counting the number of specific substrings > within a > string. I'm working on a bioinformatics coursework at the > moment, so my > string looks like this: > > $sequence = "caggaactttcggaagaccatgta"; > > I want to count the number of occurrences of each pair of > let

RE: using substr... is this efficient

2004-02-20 Thread Bakken, Luke
ooked a > *pack* and > *unpack* . it did not make any sense to me. >From my own limited performance testing (using the Benchmark module), I've found that substr is faster than unpack. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

  1   2   3   >