Good CS Literature

2001-12-27 Thread Luke
scattered (C,Java, Perl, Python..)[ALL basic stuff]but i still dont consider myself a programmer... thnx luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Good CS Literature

2001-12-27 Thread Luke
... Yes the program/script works but Im not sure if its effecient or not... thnx alot luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Reinitializing an Array

2002-03-13 Thread luke
you can always set it to undef also: @an_array=undef; --- Luke Davison [EMAIL PROTECTED] - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 13, 2002 2:59 PM Subject: Re: Reinitializing an Array &

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: ***

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

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 !

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: A Split Question

2001-07-03 Thread Luke Bakken
;, $month, "\tD: ", $day, "\tY: ", $year, "\n"; } Unpack works well with fixed format data like this. Luke On Tue, 3 Jul 2001 [EMAIL PROTECTED] wrote: > > Hi. > > My file has dates in it that either come out as "2Jul2001" or "21Jul2001"

Re: changing Unix Passwd

2001-07-03 Thread Luke Bakken
think the Expect route to be easiest. Luke On Tue, 3 Jul 2001, Tarik Jeait wrote: > Hi, > can somebody tell me how to change my unix passwd by a perl script > : > > open(FILE,"|passwd"); --> doesn't work ; > > must I open some pipe or What ? > > T.J > > Thank you >

Re: A Split Question

2001-07-03 Thread Luke Bakken
> > Unpack works well with fixed format data like this. > > Why would you use unpack when this can be easily split apart with a regex? > I'd think unpack would be overkill! > > -- Brett if you had thousands of dates to split up, unpack is much faster than regexes. way way faster. Luke

Re: Re[2]: A Split Question

2001-07-03 Thread Luke Bakken
> > >> > > > Unpack works well with fixed format data like this. NB: *fixed format* - i.e. unchanging throughout the data. > the flexibility of a regular expression. If the date style changes to, > say, 02July01 (instead of 2July2001), the regula

Re: Editor

2001-07-03 Thread Luke Bakken
www.vim.org On Tue, 3 Jul 2001, Bill Pierson wrote: > Hello again, all. > > May I get some suggestions for any Windows-based PERL development tools? Preferably, >free ones? > > Thanks, > --Bill > >

RE: Re: Editor

2001-07-06 Thread Luke Bakken
You know at the risk of starting a huge flamewar here (tho I doubt it'll happen - people seem really reasonable on this list) I'm going to put in my $0.02 for not just learning vi, but becoming fluent with it: 1. It's universally available. 2. Once you really learn it, it is the fastest editor ou

Re: Reading an Outlook "PST" file?

2001-07-06 Thread Luke Bakken
PST files are the native Outlook export format for Outlook folders. Unfortunately, they are binary files, and a quick peek shows that they might be tough to munge. I'd suggest exporting to something more text-friendly. On Fri, 6 Jul 2001, Jos I. Boumans wrote: > forgive the ignorance but what

Vi substitution (was: RE: Re: Editor)

2001-07-06 Thread Luke Bakken
In vim it's not necessary unless you use a modifier like g or c at the end. I'm not sure about "standard" vi, tho. On Fri, 6 Jul 2001, Guilherme Pinto wrote: > Couldn't agree more, but... didn't you forget to close your subtitution with a >trailing slash? > > :25,45 s/^/#/ > > vi Rocks >

Re: Executing Remote Script with parameters

2001-07-08 Thread Luke Bakken
I would investigate using rsh or (peferably) ssh to execute the remote script. if you had an account on machine 'foo', you can use RSA or DSA authentication to avoid needing a password to execute a script on foo, but this isn't an SSH group, so if you need more info, email me. there's also a Net

Re: A simple question

2001-07-10 Thread Luke Bakken
Use rsh or ssh - system "rsh -l $username $hostname ls"; for the above to wrk without a password, your client machine's hostname must be in $username's .rhosts file. Better yet, use ssh with RSA or DSA authentication - then you won't be exposing your password in plaintext. There's also a Net::

Re: automatic FTP not using NET:FTP module

2001-07-12 Thread Luke Bakken
If you can't install Net::FTP, the following works with the ftp.exe program on NT to get the file /tmp/frazzle in binary mode: open FTP, "> tmpftp.$$"; print FTP < On Wed, Jul 11, 2001 at 10:20:58AM -0700, [EMAIL PROTECTED] wrote: > > I have to automate ftp process using perl or shell scripts. At

Re: Copying Directory Trees

2001-07-13 Thread Luke Bakken
as a tar file (if it's zipped, it's much less space). Good luck! Luke On Fri, 13 Jul 2001, Scherger, Susan M. wrote: > Hello Fellow Perl Users: > I'm trying to write a script that will go to a designated server and > directory, check the age of each directory and if it i

Re: Regex giving me fits!! :-(

2001-07-17 Thread Luke Bakken
more spaces or colons, then match the date part and remember it. If you want to get both dates use the g modifier and assign the match to a list: my ($date1, $date2) = (look =~ m!\d{2}/\d{2}/\d{2,4}!g); Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regex giving me fits!! :-(

2001-07-17 Thread Luke Bakken
> this should work, tho i haven't tried it: > > $look =~ m!DATE[ :]+(\d{2}/\d{2}\d{2,4})!; should read: $look =~ m!DATE[ :]+(\d{2}/\d{2}/\d{2,4})!; ^ that's what i get for not trying it! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

Re: Making a perl script a stand-alone executable

2001-07-18 Thread Luke Bakken
installation. I've had to do this wil a script of mine since not everyone has the latest and greatest perl installed (tho they should!!!) Luke On Wed, 18 Jul 2001, Luca Veraldi wrote: > Dear Sirs, > > is there an utility I can use to convert a perl script into an executable file? That

Re: Dynamic Data structures

2001-07-18 Thread Luke Bakken
t; $food, ); } continue { $n++ } print Dumper($bears); __DATA__ foo|black bear|black|berries bar|grizzly|greyish|humans - Have fun! Luke PS - look everyone - a continue block! :-) On Wed, 18 Jul 2001, David Gi

Re: Dictionary

2001-07-19 Thread Luke Bakken
> - I've created several fairly small dictionary files - each line in them > looks more or less like that: > 'aufgedreht: lit up, activated, attracted to, interested in' if this is how the file looks, just use a simple hash: $dict{'aufgedreht'} = 'lit up, activated, attracted to, interested in';

Re: Windows Directory Parsing and Deleting

2001-07-19 Thread Luke Bakken
File::Find use function finddepth to go through directories' contents *before* looking at the dir itself. use File::Find my $wanted = sub { #skip unless the dir contains '_vti' at the beginning unless($File::Find::dir =~ /^_vti/) { return } #if we're looking at a dir,

Re: system interaction

2001-07-23 Thread Luke Bakken
ng files, etc...' then the cd, copy or xcopy commands will suffice. you really don't need perl to automate those commands. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Net::FTP

2001-07-23 Thread Luke Bakken
> mainframe specific command (there is no method in Net::FTP that corresponds > with this command). The command I need to issue is "quote site lrecl=827 > recfm=fb blksize=27291 cylinder primary=1 secondary=1". is the mainframe expecting text in ASCII or EBCDIC encoding? >From the FTP.pm module

Re: how to get date before say 20 days ?

2001-07-24 Thread Luke Bakken
time() and locatime() functions are all you need, plus you need to figure out the number of seconds in 20 days :-) On Tue, 24 Jul 2001, shweta shah wrote: > hello, > is there something in perl through which i can get > date previous to some specified days ,say 20 days befores date > i need to

USPS has me stumped!

2001-07-25 Thread Luke Bakken
o diagnose the problem, but I still get the same 500 error there (but no error otherwise). Any ideas? Thanks, Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: binary files

2001-07-31 Thread Luke Bakken
To read binary files, you need to understand read(), seek() and unpack(), as well as the underlying binary structure of the file. Peeking into the file with a hex editor will help distinguish the ASCII bits from the rest. If you know the C code that creates the file, that can help a lot! Luke

Re: Hashes with multiple values per key

2001-08-07 Thread Luke Bakken
say you're looking for element "frazzle" in the key represented by variable $key : for $ele ( @{$hash{$key}} ) { if( $ele eq 'frazzle' ) { print "YEAH\n"; } } Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Hashes with multiple values per key

2001-08-07 Thread Luke Bakken
for is faster for this limited example on my machine at this moment with the planets aligned as they are currently. Your mileage may vary :-) Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: print the array values in a hash

2001-08-16 Thread Luke Bakken
al elements: for (@{ $hash{$key} }) { print $_, "\n"; } Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl - High Level language?

2001-08-16 Thread Luke Bakken
These questions are always fun because their answers are so subjective! > Is Perl a high level language? I'd say so. > What is a high level language? I would say anything that doesn't require you to do memory management. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: PERL IS NOT A HIGH LEVEL LANGUAGE

2001-08-17 Thread Luke Bakken
eople not know anything about Perl? they probably have a bias against interpreted languages - many people do, for no good reason. then they stick with C and have to fix segfaults all day due to allocation errors - shrug. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Redirect error of shell command

2001-08-21 Thread Luke Bakken
Which shell? Which operating system? Where do you want it to go? To redirect STDERR to oblivion on NT: system "command > nul"; On UNIX: system "command 2> /dev/null" On Tue, 21 Aug 2001, Janice Pickron wrote: > Hello Perl Guru! > > How do you redirect the standard error of a shell command?

Re: Strip charactes from every element in array

2001-08-23 Thread Luke Bakken
When you do a for loop : for (@array) { s/1//g; } the implicit $_ in the loop becomes an alias for the real element - so by modifying the element in the loop you're actually modifying the "real" one in the array. Luke PS you could use map here as well, but it's in

Re: ActiveState and PPM

2001-08-31 Thread Luke Bakken
t; > install Text-Autoformat Luke On Thu, 30 Aug 2001, bentwingedbird wrote: > I'm currently trying to install a module for > ActiveState Perl. I'm running W2K. > > I've attempted to use PPM, but am having little > success so far. I've set the environment variable

Re: Env for Cmds run in backticks

2001-10-05 Thread Luke Bakken
He wants to affect the environment of the process he's calling. Try this: $frazzle = 'exported string'; $ENV{'FRAZZLE'} = $frazzle; $output = `ksh -c \'print \$FRAZZLE\'`; print $output; On Thu, 4 Oct 2001, Brett W. McCoy wrote: > On Thu, 4 Oct 2001, Kingsbury, Michael wrote: > > > Is there

Re: File::Path oddity

2001-10-19 Thread Luke Bakken
is your umask 022? On Fri, 19 Oct 2001, birgit kellner wrote: > use File::Path; > my $newdir = "testdirectory"; > mkpath(["$newdir"]); > > According to the File::Path description, creating a directory should set > its permissions to 777 per default. > However, I find that the above code creates

Re: conversion of ascii -> "English Text" on solaris

2001-10-22 Thread Luke Bakken
try putting: binmode HTML, ":text"; immediately after the open. On Mon, 22 Oct 2001, dan.kelley wrote: > > hi- > > i'm tring to write a simple script that opens a set of html files and > replaces one hunk of text with another. i'm using 5.6.0 on solaris 8. > the script runs fine, and correctl

Re: conversion of ascii -> "English Text" on solaris

2001-10-23 Thread Luke Bakken
Your version of perl must not support that discipline on the binmode function. I think you need perl 5.6.1 for this. Try the three-argument open() call : perldoc -f open Good luck!! Luke On Mon, 22 Oct 2001, dan.kelley wrote: > > no dice: i tried adding this immediately after th

Re: Changing a Unix password.

2001-10-29 Thread Luke Sibala
On Mon, 29 Oct 2001 11:15:19 +1030 "Daniel Falkenberg" <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a small CGI script here that is used to change users Unix > passwords. Now before we go into security let me just tell you that the > script is only accessable via a user name and password. T

Re: flock() question

2001-10-31 Thread Luke Bakken
use Fcntl qw(:flock); until(flock $fh, LOCK_EX|LOCK_NB) { $lockwait++; if($lockwait == 10) { print STDERR "timed out waiting for lock\n"; exit 1; } sleep 1; } this will do a non-blocking attempt to get the lock, and try 10 t

Re: stoopid newbie formmail question

2001-11-25 Thread Luke SIbala
On Sun, 25 Nov 2001 01:45:19 + "neill roy" <[EMAIL PROTECTED]> wrote: > hi, i am very new to perl and cgi so please excuse this dull, stoopid > question... > > > but i'm trying to write a formmail program and i'm getting very frustrated > cos it works in Opera 5.12 and NS6.1 but for some

Re: How many arguments can perl take?

2001-11-28 Thread Luke Bakken
Also, the backreference is unnecessary as your captured string is just a literal string. Let me know if this helps your problem. Luke > It seems to run fine and changes many files, but when I go searching > for the string that was supposed to be changed, I keep finding more > file. Many w

Re: Sending mail on a Win32 system.

2001-11-29 Thread Luke Bakken
Mail::Sendmail works fine - perhaps you don't have the SMTP server setting correct or no access to a server? Luke On Thu, 29 Nov 2001, Aaron Petry wrote: > I've seen all sorts of ways to send mail on a *nix system, but I can't > find a good module to use with Win

Re: file test

2001-11-30 Thread Luke Bakken
Actually `dir /B` won't produce anything since dir isn't a real coomand - it's a shell builtin. This may help: c:\>perl -e"for (<*>) { print $_, qq(\n) if(! -x $_ && -B $_ ) }" Luke On Thu, 29 Nov 2001, Carl Rogers wrote: > At 08:09 PM 11/29/2001

Re: traversing Windows directories

2001-12-05 Thread Luke Bakken
File::Find Or, if j:\foo\bar\logs has only 1 level of sub folders, use opendir on that dir and read the contents, finding items that are also directories, which you can then do another opendir on. Luke On Wed, 5 Dec 2001, Torres, Jose wrote: > Hi, > > How do you traverse Windows di

Re: Date stuff

2002-01-10 Thread Luke Bakken
three days ago = $threedays = time() - (3 * 24 * 60 * 60); @date = localtime($threedays); On Wed, 9 Jan 2002, Jeff 'japhy' Pinyan wrote: > On Jan 9, Scott Taylor said: > > >Can anyone tell me how I can set a variable to a date, then subtract x > >number of days from it and output the new date

Re: interesting JAPH, how does this work?

2002-01-10 Thread Luke Bakken
$A\n);" c C:\users>perl -e "$A=qq(a);for(0){$A++}print qq($A\n);" b C:\users>perl -e "$A=qq(a);for(0..10){$A++}print qq($A\n);" l C:\users>perl -e "$A=qq(a);for(0..26){$A++}print qq($A\n);" ab C:\users> etc etc etc :-) Luke On Thu, 10 Jan 2002,

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(

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

Modify excel worrkbook in perl

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

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

Capture URL parameter

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

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]

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 ?

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

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

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

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

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

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

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

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-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

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: 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

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-20 Thread luke devon
. $#; } else { $url .= "?#=" . $# . "-" . $### . "-" . $#####; } print $url."\n"; } else { print "\n"; } } }else { print "\n"; } my $sth->finish();

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: 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: 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: "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: 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: 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

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: 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 {

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: 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: 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: 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: 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: 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: 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 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-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: 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: 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: 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
> >> > #!/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: 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: 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: 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: 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-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
> > 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) =

  1   2   3   >