Perl and Unix/Linux Tutorials

2005-09-06 Thread Mark Sargent
Hi All, can anyone point me to some sites(tutorials) that deal with Perl and Linux(Unix) admin stuff.? I'm hoping to use Perl for just that, as opposed to Web stuff etc. I've been following this tutorial, http://www.codebits.com/p5be/ which is great. Certainly well written for a newbie. Also,

Re: naming subroutine reference parameter?

2005-09-06 Thread Jeff Pan
> > my (%hash,@array); > > &sub_test(\%hash,[EMAIL PROTECTED]); > > & has special meaning so it should be dropped when not needing > particular special behavior. I can't understand for this,can u give me some examples? > > my %hash=%$hash_ref; > > my @[EMAIL PROTECTED]; > > This isn't needed

Re: Extracting data from the Properties tab of a jpeg

2005-09-06 Thread Chris Devers
On Tue, 6 Sep 2005, Daniel Smith wrote: > My question is, how do I get the information out of these file fields > into some sort of delimited file? Any suggestions? Your question is "how do I poke at the EXIF data in a JPEG image"? JPEGs store metadata -- file size, file date, camera make, cam

Re: Substitution problem

2005-09-06 Thread John W. Krahn
John W. Krahn wrote: > Moon, John wrote: >>Does any one know how to do this with just a substitution? >> >>perl -e '$a=q{Data.m1234.D1234567890}; >> $a =~/\d+$/; >> $numbers = q{#} x length($&); >> $a=~ s/\d+$/$numbers/; print "$a\n";' >> >>What " Data.m1234.D## " as a result

Re: infile data

2005-09-06 Thread John W. Krahn
Tom Allison wrote: >>>I ended up with something like: >>>my $string = join('',()); >>>my ($sql1, $sql2) = split(/\nn\n/sm, $string); >> ^ >>You probably meant /\n\n/. > Yes, thanks >> >>>But I like the $/ idea. >>You could set $/ to paragraph mode: >> >>my ( $sql1,

Re: infile data

2005-09-06 Thread Tom Allison
>> I ended up with something like: >> my $string = join('',()); >> my ($sql1, $sql2) = split(/\nn\n/sm, $string); >^ >You probably meant /\n\n/. Yes, thanks > > >> But I like the $/ idea. > >You could set $/ to paragraph mode: > >my ( $sql1, $sql2 ) = do { local

Re: Substitution problem

2005-09-06 Thread John W. Krahn
Moon, John wrote: > Does any one know how to do this with just a substitution? > > perl -e '$a=q{Data.m1234.D1234567890}; > $a =~/\d+$/; > $numbers = q{#} x length($&); > $a=~ s/\d+$/$numbers/; print "$a\n";' > > What " Data.m1234.D## " as a result. $ perl -le'$_ = q{Da

RE: Substitution problem

2005-09-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Moon, John wrote: > Does any one know how to do this with just a substitution? > > perl -e '$a=q{Data.m1234.D1234567890}; > $a =~/\d+$/; > $numbers = q{#} x length($&); > $a=~ s/\d+$/$numbers/; print "$a\n";' > > What " Data.m1234.D## " as a result. > > John W Moon Did

Substitution problem

2005-09-06 Thread Moon, John
Does any one know how to do this with just a substitution? perl -e '$a=q{Data.m1234.D1234567890}; $a =~/\d+$/; $numbers = q{#} x length($&); $a=~ s/\d+$/$numbers/; print "$a\n";' What " Data.m1234.D## " as a result. John W Moon -- To unsubscribe, e-mail: [EMAIL

Re: infile data

2005-09-06 Thread John W. Krahn
Tom Allison wrote: > Matija Papec wrote: >> Tom Allison wrote: >> >>> I've been using the practice of putting something at the bottom of a >>> file for holding static data, like SQL, by calling a __DATA__ handle: >>> >>> my $sql = join('',()); >> >> #more efficient >> my $sql = do { local $/; }; >

Re: infile data

2005-09-06 Thread Tom Allison
Matija Papec wrote: Tom Allison wrote: I've been using the practice of putting something at the bottom of a file for holding static data, like SQL, by calling a __DATA__ handle: my $sql = join('',()); #more efficient my $sql = do { local $/; }; check perldoc perlvar if you want to know mo

RE: Unable to use XML module

2005-09-06 Thread Brian Volk
See bottom... -Original Message- From: Cristi Ocolisan [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 6:48 AM To: beginners@perl.org Subject: RE: Unable to use XML module Try install XML-Simple Co -Original Message- From: Nath, Alok (STSD) [mailto:[EMAIL PROTECTED

Re: Extracting data from the Properties tab of a jpeg

2005-09-06 Thread Jay Savage
On 9/6/05, Daniel Smith <[EMAIL PROTECTED]> wrote: > Hello all, > > I was wondering if someone could shed some light on my problem. I have over > 1000 jpeg images that need to be added to a database that we run here on > center. Problem is, the database folks want all of the metadata (Title, > S

RE: Extracting data from the Properties tab of a jpeg

2005-09-06 Thread Cintron,Jose J.
You may want to take a look at the Image::Info module (http://search.cpan.org/~gaas/Image-Info-1.16/lib/Image/Info.pm) +-- | José J. Cintrón - <[EMAIL PROTECTED]> +-- -Original Message- From: Daniel Smith [m

Extracting data from the Properties tab of a jpeg

2005-09-06 Thread Daniel Smith
Hello all, I was wondering if someone could shed some light on my problem. I have over 1000 jpeg images that need to be added to a database that we run here on center. Problem is, the database folks want all of the metadata (Title, Subject, Keywords, Comments, Author) put into a text file for

5.6 versus 5.8

2005-09-06 Thread Bowen, Bruce
In the file Brucesubs2.pm: #!/usr/bin/perl # somesubs.pm package Brucesubs2; use strict; $Brucesubs2::scr = "123"; $Brucesubs2::lang = "000"; In the file Brucesub2.pl #!/usr/bin/perl # srandcall.pl use warnings; use strict; use Brucesubs2; print $Brucesubs2::lang, " and ", $Brucesubs2::scr

Re: infile data

2005-09-06 Thread John W. Krahn
Tom Allison wrote: > I've been using the practice of putting something at the bottom of a > file for holding static data, like SQL, by calling a __DATA__ handle: > > my $sql = join('',()); > > > > __DATA__ > select . > > > Is there any way to do this twice? > To define two sets of static

Re: Sort Contents of an Array

2005-09-06 Thread JupiterHost.Net
Chico wrote: I want to query three different databases and put all the data into an array (which works fine). Next I want to convert the timestamps in the array to epochtime (Unix Time), then sort the array, and then convert back to original time stamp. Can anyone help? GET the EPOCH time f

Re: nice low cost ISP with support for mod_perl, any suggestions

2005-09-06 Thread Wiggins d'Anconia
Adriano Ferreira wrote: > I am on the verge of trying to deploy a small web application for > small business. I would like to see it working preferably under > mod_perl. Does anyone has suggestions about possible providers with a > good compromise between service quality and cost? As it is directe

RE: Just need a yes or no answer on passing a hash to a package

2005-09-06 Thread Timothy Johnson
This is exactly why it is better to use references. When you pass arguments to a subroutine or package, whatever you pass is "flattened out" into one list. The end result is that if you pass just one array or hash, it will work, because when you assign it on the other end, Perl will automatica

Sort Contents of an Array

2005-09-06 Thread Chico
I want to query three different databases and put all the data into an array (which works fine). Next I want to convert the timestamps in the array to epochtime (Unix Time), then sort the array, and then convert back to original time stamp. Can anyone help? Here is my script: ###Use DBI to Make

Re: How do you force SOAP::Lite to use document/literal SOAP messages?

2005-09-06 Thread Matija Papec
David Adams wrote: I am trying to write a simple SOAP client written in perl and to talk to a webservice written in .NET. I am unsuccessful. I believe the web service is expecting document/literal SOAP messages but I think the SOAP::Lite module sends stuff in RPC/encoded messages. Is ther

Re: naming subroutine reference parameter?

2005-09-06 Thread Matija Papec
Jeff Pan wrote: > Passing reference as parameter to subroutine is as easy as the normal > way.And,if u pass some types of parameter such as hash,array,or handle > to subroutine,using reference instead is more safer. > for example,such below code is right: It is, however it could be better. > my

Re: infile data

2005-09-06 Thread Matija Papec
Tom Allison wrote: I've been using the practice of putting something at the bottom of a file for holding static data, like SQL, by calling a __DATA__ handle: my $sql = join('',()); #more efficient my $sql = do { local $/; }; check perldoc perlvar if you want to know more about $/ __DATA__

Re: naming subroutine reference parameter?

2005-09-06 Thread Dave Gray
On 9/6/05, Jayvee Vibar <[EMAIL PROTECTED]> wrote: > How do you name subroutine reference parameter in perl? > Naming a local or pass by value is by simply using my ($param1, $param2) = > @_ ; > How about by reference? I think it would be harder if I'll be using $_[0], > $_[1] direct method. > Is i

Re: arbitrarily small floating point numbers

2005-09-06 Thread Jay Savage
On 9/5/05, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: Jay Savage <[EMAIL PROTECTED]> > > On 9/3/05, Sagar Nargundkar <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > > I need to use small floating point numbers. Is there a perl module > > > that allows us to use arbitrarily small floats (of th

How do you force SOAP::Lite to use document/literal SOAP messages?

2005-09-06 Thread David Adams
I am trying to write a simple SOAP client written in perl and to talk to a webservice written in .NET. I am unsuccessful. I believe the web service is expecting document/literal SOAP messages but I think the SOAP::Lite module sends stuff in RPC/encoded messages. Is there any way of telling

Re: hash question

2005-09-06 Thread Gergely Buday
Thank you all for your answers. - Gergely -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

infile data

2005-09-06 Thread Tom Allison
I've been using the practice of putting something at the bottom of a file for holding static data, like SQL, by calling a __DATA__ handle: my $sql = join('',()); __DATA__ select . Is there any way to do this twice? To define two sets of static SQL? -- To unsubscribe, e-mail: [EMAIL PROT

Re: UNIVERSAL class like functionality for non-OO?

2005-09-06 Thread Rex Rex
For logging, why don't you try log4perl? http://log4perl.sourceforge.net/ Cheers, Rex On 9/4/05, Peter Rabbitson <[EMAIL PROTECTED]> wrote: > > Hello list, > Is there a clean and elegant way to make a subroutine available to all > namespaces/packages? Something like the UNIVERSAL class for ob

Re: hash question

2005-09-06 Thread Jeff 'japhy' Pinyan
On Sep 6, Gergely Buday said: do you have a clue why is this not working? The interpreter complains about a syntax error in line 7 near $myhash. You have written '$myhash($ky)' when you meant to write '$myhash{$ky}'. You have also written '%myhash = { ... }' when you meant to write '%myhash

Use of find2perl utility

2005-09-06 Thread Sastry
Hi The perl document says that with the use of find2perl, "the resulting code is typically faster than running find itself" 1) Can you tell me how it is? 2) Does it provide all the functionalities that normal 'find' utility provided in bash/korne shell? Thanks in advance Ravi Sastry

Re: naming subroutine reference parameter?

2005-09-06 Thread Jeff Pan
On Tue, 6 Sep 2005 16:12:35 +0800, "Jayvee Vibar" <[EMAIL PROTECTED]> said: > How do you name subroutine reference parameter in perl? > Naming a local or pass by value is by simply using my ($param1, $param2) > = > @_ ; > How about by reference? I think it would be harder if I'll be using > $_[0],

RE: Unable to use XML module

2005-09-06 Thread Cristi Ocolisan
Try install XML-Simple Co -Original Message- From: Nath, Alok (STSD) [mailto:[EMAIL PROTECTED] Sent: Monday, September 05, 2005 10:14 AM To: Charles K. Clarkson; Xavier Noria Cc: Perl Beginners List Subject: RE: Unable to use XML module When I say ppm>install XML::Simple It gives this

naming subroutine reference parameter?

2005-09-06 Thread Jayvee Vibar
How do you name subroutine reference parameter in perl? Naming a local or pass by value is by simply using my ($param1, $param2) = @_ ; How about by reference? I think it would be harder if I'll be using $_[0], $_[1] direct method. Is it possible? Thanks. -- To unsubscribe, e-mail: [EMAIL PROT

Re: hash question

2005-09-06 Thread Ankur Gupta
On 9/6/2005 4:50 PM Gergely Buday wrote: Hi there, do you have a clue why is this not working? The interpreter complains about a syntax error in line 7 near $myhash. Seems like you are confused with the brackets... #!/usr/bin/perl %myhash = { "alma" => "apple", "korte" => "pear" }; Shou

Re: hash question

2005-09-06 Thread Shobha Deepthi
Its should be , print $ky, ":" , $myhash{$ky}, "\n"; Shobha Deepthi V The statement below is true. The statement above is false. Gergely Buday wrote: Hi there, do you have a clue why is this not working? The interpreter complains about a syntax error in line 7 near $myhash. #!/usr/bin

hash question

2005-09-06 Thread Gergely Buday
Hi there, do you have a clue why is this not working? The interpreter complains about a syntax error in line 7 near $myhash. #!/usr/bin/perl %myhash = { "alma" => "apple", "korte" => "pear" }; foreach $ky (keys (%myhash)) { print $ky, ":" , $myhash($ky), "\n"; } -- To unsubscribe, e-m