RE: recurive chown with perl chown

2009-06-19 Thread Andrew Curry
http://www.perlmonks.org/?node_id=202898 may be of use. -Original Message- From: news [mailto:n...@ger.gmane.org] On Behalf Of Harry Putnam Sent: 19 June 2009 14:36 To: beginners@perl.org Subject: recurive chown with perl chown How to manage a recursive chown using perl function chown?

RE: Simple regex question

2009-05-19 Thread Andrew Curry
A crude one ($part,$unit,$x,$y,$xlen,$ylen) = ($1,$2,$3,length($4),length($5)) if ($string =~ /(^\S{5})\.(\d{2})([+-])(\d+)\.(\d+)$/); -Original Message- From: Dan Fish [mailto:d...@ninemoons.com] Sent: 19 May 2009 14:18 To: beginners@perl.org Subject: Simple regex question Simple

RE: [Fwd: Re: Determining if a file is more than so many days old]

2008-11-20 Thread Andrew Curry
If your on unix you can just use find with -mtime and an exec rm. If all you want to do is perge files. -Original Message- From: Raymond Wan [mailto:[EMAIL PROTECTED] Sent: 20 November 2008 15:39 To: beginners@perl.org Subject: [Fwd: Re: Determining if a file is more than so many days

RE: Reg : Browser Back Button

2008-11-03 Thread Andrew Curry
Actually using javascript it is possible although probably not recommended and again can not be guaranteed to work on all browsers. -Original Message- From: Rob Coops [mailto:[EMAIL PROTECTED] Sent: 03 November 2008 10:42 To: beginners@perl.org Subject: Re: Reg : Browser Back Button On

RE: Perl equivalent of sed -f or awk -f

2008-09-02 Thread Andrew Curry
Perl -p -i -e s/search/replace/extras; FILENAME -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 02 September 2008 15:06 To: beginners@perl.org Subject: Perl equivalent of sed -f or awk -f I'd like to apply a series of inline edits to a file in Perl. With

RE: What is wrong with this script ??

2008-08-20 Thread Andrew Curry
Depending on your server the error could be that the group doesn't exist i.e. on unix you would need to add the groups to /etc/group first. -Original Message- From: Jyotishmaan Ray [mailto:[EMAIL PROTECTED] Sent: 20 August 2008 13:17 To: beginners@perl.org Subject: What is wrong with

RE: doubt

2008-08-20 Thread Andrew Curry
Im going with empty string or null. -Original Message- From: Irfan J Sayed (isayed) [mailto:[EMAIL PROTECTED] Sent: 20 August 2008 14:34 To: beginners@perl.org Subject: doubt Hi All, Can you please tell me what is the value of $file. When i execute this script . it says Can't open :

RE: what is ^M at the end of a line?

2008-05-21 Thread Andrew Curry
If your trying to do this on a unix based system ^M is equivalent to \r\n so you can get rid of \r I believe. -Original Message- From: Remy Guo [mailto:[EMAIL PROTECTED] Sent: 21 May 2008 15:20 To: Rob Coops Cc: Perl Beginners Subject: Re: what is ^M at the end of a line? it's really

RE: question on foreach loop

2008-05-01 Thread Andrew Curry
-Original Message- rom: J. Peng [mailto:[EMAIL PROTECTED] Sent: 01 May 2008 15:31 To: [EMAIL PROTECTED] Cc: beginners@perl.org Subject: Re: question on foreach loop To add a statement of print $_ follow the foreach, you will see what was happening. foreach (@data){ print $_\n;

RE: hash return from a sub

2008-04-28 Thread Andrew Curry
Ill make a guess it's a scope issue, but cant be sure without the main code. Try something like use strict; my %test=mysub(); print %test; sub mysub { my(%myhash,$var1,$var2); $var1 = '1'; $var2 = '2'; $myhash{$var1} = $var2; print %myhash; return ( %myhash

RE: sql and perl

2008-04-28 Thread Andrew Curry
-Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: 28 April 2008 17:53 To: beginners@perl.org Cc: Francisco Valladolid Subject: Re: sql and perl Francisco Valladolid wrote: I want to start learning about sql and how it interacts w/ perl. My rough idea is to install

RE: Joining/Merging AoA

2008-04-24 Thread Andrew Curry
As this is a beginners list are you going to explain... push my @c, [EMAIL PROTECTED] @a}]; push @{$c[0]}, (@{shift @b})[1]; $c[$_-[0]] = [ @{$_} ] while $_ = shift @a; push @{$c[$_-[0]]}, $_-[1] while $_ = shift @b; -Original Message- From: Jay Savage [mailto:[EMAIL

RE: find an entry in hash array

2008-03-20 Thread Andrew Curry
%hash = map { $_ = 1 } @array; is just a funny way to write %hash = (); foreach $_ (@array) { $hash{$_} = 1; } -Original Message- From: Sharan Basappa [mailto:[EMAIL PROTECTED] Sent: 20 March 2008

RE: variable help

2008-03-04 Thread Andrew Curry
Be warned though that int isn't cleaver enough to deal with say... $x='0'; print int($x); still says it's a string as It is. If you are not 100% sure then you can also do if ($x =~/^\d*$/) for an actual integer i.e. a number in the positive whole set of numbers { 1,2,3} or negative whole

RE: variable help

2008-03-04 Thread Andrew Curry
Correction its not that it's a string (which it is) its that int doesn't like 0 even thought it's an integer by definition. -Original Message- From: Andrew Curry [mailto:[EMAIL PROTECTED] Sent: 04 March 2008 20:52 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: beginners@perl.org Subject

RE: variable help

2008-03-04 Thread Andrew Curry
PROTECTED] Sent: 04 March 2008 21:45 To: beginners@perl.org Subject: Re: variable help Andrew == Andrew Curry [EMAIL PROTECTED] writes: Andrew If you are not 100% sure then you can also do if ($x =~/^\d*$/) for an Andrew actual integer i.e. a number in the positive whole set of numbers { Andrew 1,2,3

RE: Ideas for matching several lines of code (C)

2008-01-16 Thread Andrew Curry
May be being too simplistic but What about Perl -p -I -e s/special/\special/g; files -Original Message- From: Mike Martin [mailto:[EMAIL PROTECTED] Sent: 16 January 2008 15:06 To: Beginners List Subject: Ideas for matching several lines of code (C) Hi I am trying to extract about 10

RE: Not catching HUP signal - Perl Sybase

2007-12-13 Thread Andrew Curry
Look at $SIG{INT)=\catch_signal; Sub catch_signal { $signal=shift; # # do something # exit; } -Original Message- From: NewbeeUnix [mailto:[EMAIL PROTECTED] Sent: 13 December 2007 03:57 To: beginners@perl.org Subject: Re: Not catching HUP signal - Perl Sybase Sorry for replying

RE: fixed list combinatorics

2007-11-28 Thread Andrew Curry
ABC ABCD B BC BCD C CD D -Original Message- From: Andrew Curry [mailto:[EMAIL PROTECTED] Sent: 28 November 2007 15:43 To: Dan Klose; beginners@perl.org Subject: RE: fixed list combinatorics Not sure this exactly what you want but use strict; my ( @list, @comb ); @list = ( 1, 2, 3, 4

RE: fixed list combinatorics

2007-11-28 Thread Andrew Curry
Not sure this exactly what you want but use strict; my ( @list, @comb ); @list = ( 1, 2, 3, 4 ); combinations( [EMAIL PROTECTED], [EMAIL PROTECTED] ); print join ( \n, @comb ); sub combinations { my ( $list, $comb ) = @_; my ( $key, $i, $x, $line, @comb ); foreach my

RE: :FTP troubles with passive

2007-11-20 Thread Andrew Curry
Passive - If set to a non-zero value then all data transfers will be done using passive mode. If set to zero then data transfers will be done using active mode. -Original Message- From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED] Sent: 20 November 2007 15:25 To: beginners@perl.org

RE: how do do work on a whole bunch of arrays in parrel

2007-11-05 Thread Andrew Curry
Pretty much how you have written it use strict; use vars qw(@a @b @c @d); @a=(1,2,3,4); @b=(5,6,7,8); @c=(9,10,11,12); @d=(13,14,15,16); foreach (@a,@b,@c,@d) { # #do what you like here # } If that's really what you want to do, You can also join all the hashes together, use a hash etc... it

RE: printf problem

2007-10-30 Thread Andrew Curry
try using sprintf instead of printf. i think the extra 1 you are getting on the end it just a true return. -Original Message- From: Julie A. Bolduc [mailto:[EMAIL PROTECTED] Sent: 30 October 2007 00:23 To: beginners@perl.org Subject: printf problem I am trying to format some numbers so

RE: Split function

2007-10-30 Thread Andrew Curry
try chomp(my @strm = split(/\s+/, $IntegrationStream)); as your only splitting on 1 space where 2 are present in your string. -Original Message- From: Sayed, Irfan (Irfan) [mailto:[EMAIL PROTECTED] Sent: 30 October 2007 09:38 To: beginners @ perl. org Subject: Split function Hi All,

RE: array within array

2007-10-29 Thread Andrew Curry
be very careful with exists, it auto creates the structure i.e. use Data::Dumper; my %hash; if (exists $hash{a}{b}) { } print Dumper(\%hash) then the next time you use exists it is there. defined is much safer as it doesnt do this. -Original Message- From: Beginner [mailto:[EMAIL

RE: Trying to figure the Regex Please Help

2007-10-24 Thread Andrew Curry
^([a-zA-Z0-9_\-\.]+ # any character repeated from the set memorized into $1 )@ # followed by an @ ([a-zA-Z0-9_\-\.]+) # any character repeated from the set memorized into $2 \.([a-zA-Z]{2,5})$ # any alphabetic character in both cases 2 - 5 in length into $3 It looks like it will match an email

RE: Trying to figureout regex please help

2007-10-24 Thread Andrew Curry
A better one for email may be [EMAIL PROTECTED] \.]*[a-zA-Z]$ -Original Message- From: Omega -1911 [mailto:[EMAIL PROTECTED] Sent: 24 October 2007 08:48 To: beginners perl Subject: Re: Trying to figureout regex please help 1. ^([a-zA-Z0-9_\-\.]+)@ Can contain a group of letters (case

RE: Trying to figureout regex please help

2007-10-24 Thread Andrew Curry
Or If you want to be really silly http://ex-parrot.com/~pdw/Mail-RFC822-Address.html -Original Message- From: Andrew Curry [mailto:[EMAIL PROTECTED] Sent: 24 October 2007 09:13 To: Omega -1911; beginners perl Subject: RE: Trying to figureout regex please help A better one for email

RE: Sleep apnea

2007-10-16 Thread Andrew Curry
Try setting buffering off, its probably due to that as it should do a,b,c -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 16 October 2007 02:50 To: beginners@perl.org Subject: Sleep apnea I would expect the following script: use strict; use

RE: why cant execute error ?

2007-10-15 Thread Andrew Curry
Your calling your execute with a variable of some kind but your sql has no place holders for your bind variable i.e. you would have '?' in your sql i.e. select value,test from res_prior where res_prior_id=? - execute(12); -Original Message- From: pauld [mailto:[EMAIL PROTECTED] Sent: 15

RE: Hash receive Array

2007-10-09 Thread Andrew Curry
In what sense? So you mean can a hash reference an array 'a' = [EMAIL PROTECTED] ? -Original Message- From: Rodrigo Tavares [mailto:[EMAIL PROTECTED] Sent: 09 October 2007 15:09 To: beginners@perl.org Subject: Hash receive Array Hello, I created a hash with some elements and keys.

RE: Abnormal behavior of print / syswrite

2007-09-20 Thread Andrew Curry
Are you versions of perl the same on both boxes, it sounds like your concatenation isnt working as expected on one. Try just my $message = Completed CODE standards checks.\nFor details, refer to the file. why concatinate when you don't have too. -Original Message- From: Sundeep

RE: White space split

2007-09-20 Thread Andrew Curry
Split returns an array So you need to do something like #!/bin/perl $cmd=maheshverama #XX#; ($key,$value)=split(/\s+/,$cmd); print $key, $value\n; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 September 2007 12:56 To:

RE: White space split

2007-09-20 Thread Andrew Curry
Appologies typo, I know the difference thanks. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 September 2007 12:57 To: beginners@perl.org Subject: RE: White space split --- Andrew Curry [EMAIL PROTECTED] wrote: Split returns an array returns a list

RE: RE: White space split

2007-09-20 Thread Andrew Curry
Try my $cmd1 = (split/\s+/,$cmd)[0]; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 September 2007 13:04 To: [EMAIL PROTECTED]; Andrew Curry Cc: beginners@perl.org Subject: Re: RE: White space split --- [EMAIL PROTECTED] wrote: Thanks Andrew and Jeff

RE: unix commands

2007-09-20 Thread Andrew Curry
Think you mean foreground or background. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 September 2007 15:59 To: lerameur; beginners@perl.org Subject: Re: unix commands --- lerameur [EMAIL PROTECTED] wrote: Hello, I want to write a perl script that

RE: Help on unix command find.

2007-09-19 Thread Andrew Curry
You need to specify your destination direcory in your find. find . -type f -name create*table*.pl -ok cp {} location \; -Original Message- From: Purohit, Bhargav [mailto:[EMAIL PROTECTED] Sent: 19 September 2007 10:36 To: beginners@perl.org Subject: Help on unix command find. Hi

RE: parsing csv-file for inserting in database

2007-09-19 Thread Andrew Curry
open(CSV,Kalkulation_Tauchsportportal.csv) || die CSV-Datei nicht gefunden\; you have \ your -Original Message- From: Ruprecht Helms [mailto:[EMAIL PROTECTED] Sent: 19 September 2007 10:40 To: Chas Owens Cc: Jonathan Lang; beginners@perl.org Subject: Re: parsing csv-file for inserting

RE: parsing csv-file for inserting in database

2007-09-19 Thread Andrew Curry
@Datenfelder = split(/,,,$Felder); Guessing this line. Split (//,$string) -Original Message- From: Ruprecht Helms [mailto:[EMAIL PROTECTED] Sent: 19 September 2007 15:00 To: Andrew Curry Cc: Chas Owens; Jonathan Lang; beginners@perl.org Subject: Re: parsing csv-file for inserting

RE: adding data to a file before it gets regexed

2007-09-13 Thread Andrew Curry
But whats your end goal? What is it going to do at the end? -Original Message- From: Pat Rice [mailto:[EMAIL PROTECTED] Sent: 13 September 2007 14:16 To: Chas Owens Cc: beginners@perl.org Subject: Re: adding data to a file before it gets regexed Thanks Chas for the reply what I'm

RE: Help with data returned by regex match

2007-09-12 Thread Andrew Curry
providing you match works you need () around the pattern i.e. @matches = ( $string =~ m/ expression /xgsi ); otherwise it just returns the scalar result it believe i.e. the number of matches _ From: kapil v [mailto:[EMAIL PROTECTED] Sent: 12 September 2007 07:44 To: Andrew Curry

RE: Help with data returned by regex match

2007-09-11 Thread Andrew Curry
What exactly are you trying to do and what values are you using for your test? -Original Message- From: kapil.V [mailto:[EMAIL PROTECTED] Sent: 11 September 2007 07:06 To: beginners@perl.org Subject: Help with data returned by regex match Hi, #!/usr/bin/perl -w my $path = shift; my

RE: User input: dates spanning multiple months

2007-09-10 Thread Andrew Curry
http://www.unix.org.ua/orelly/perl/cookbook/ch03_06.htm -Original Message- From: Angerstein [mailto:[EMAIL PROTECTED] Sent: 10 September 2007 14:33 To: 'Mathew Snyder'; 'Perl Beginners' Subject: AW: User input: dates spanning multiple months First I would use unix internal time

RE: User input: dates spanning multiple months

2007-09-10 Thread Andrew Curry
use Date::Calc qw(Delta_Days); @bree = (1981, 6, 16); # 16 Jun 1981 @nat = (1973, 1, 18); # 18 Jan 1973 $difference = Delta_Days(@nat, @bree); print There were $difference days between Nat and Bree\n; There were 3071 days between Nat and Bree -Original Message- From:

RE: How to read Perl source code

2007-09-05 Thread Andrew Curry
The majority of these are compiled c programs. Im not sure of split but I know many are many which are. -Original Message- From: PeiYu Zeng [mailto:[EMAIL PROTECTED] Sent: 05 September 2007 14:42 To: beginners@perl.org Subject: How to read Perl source code I'd like to read the built-in

RE: spliting

2007-09-04 Thread Andrew Curry
Just to clarify you have a file which is basically 1 string but you know every 60 characters is a new set of data? -Original Message- From: Pedro Soto [mailto:[EMAIL PROTECTED] Sent: 04 September 2007 13:29 To: beginners@perl.org Subject: spliting Hi, I have a file with lines of 60

RE: spliting

2007-09-04 Thread Andrew Curry
split(//,$string); _ From: Pedro Soto [mailto:[EMAIL PROTECTED] Sent: 04 September 2007 13:50 To: Andrew Curry Cc: beginners@perl.org Subject: Re: spliting Well, Sorry if I was not clear enough. I want to read lines from a file and I need to split the line into characters. I know you

RE: Want to interactively run a shell script

2007-09-04 Thread Andrew Curry
Something along this usually works to interact with programs through perl, this could be edited for your purpose. This does a simple tail but you can guess the rest. #!/usr/local/bin/perl -w use Data::Dumper; use File::Copy; use IPC::Open3; use IO::Select; use IO::Handle; use strict; use vars

RE: Want to interactively run a shell script

2007-09-04 Thread Andrew Curry
+/); if ( $readbuff =~ /something here/ ) { syswrite $write, 0\n; } sleep(1); } } sub close_handles { my ( $r, $w, $e ) = @_; $r-close(); $e-close(); $w-close(); } Please note this hasn't been run. -Original Message- From: Andrew Curry

RE: how to get parameters from another form

2007-09-03 Thread Andrew Curry
Whilst using strict perl you cant, you can via java script and pass those values. Its tricky to do but its possible -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 03 September 2007 09:15 To: beginners@perl.org Subject: Re: how to get parameters from another

RE: how to remove ^M character from every line

2007-09-03 Thread Andrew Curry
s/\r\n/\n/g If you want to replace it with a new lime ^M is \r\n -Original Message- From: divya [mailto:[EMAIL PROTECTED] Sent: 03 September 2007 12:57 To: beginners@perl.org Subject: how to remove ^M character from every line Hi , A file generated on Windows machine is used on linux

RE: how to remove ^M character from every line

2007-09-03 Thread Andrew Curry
That will just remove all space (\s+$) at the end of the file. \r \n are different -Original Message- From: Beginner [mailto:[EMAIL PROTECTED] Sent: 03 September 2007 12:57 To: beginners@perl.org Subject: Re: how to remove ^M character from every line On 3 Sep 2007 at 17:26, divya

RE: Regex help

2007-09-03 Thread Andrew Curry
Christ That's certainly 1 way ;) -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: 03 September 2007 16:11 To: Perl beginners Subject: Re: Regex help Beginner wrote: Hi, Hello, I am trying to come up with a regex to squash multiple commas into one. The line I

RE: Regex help

2007-09-03 Thread Andrew Curry
Think s/(\,+\s*)+/,/g; Should work It produces SPEED OF LIGHT,LIGHT SPEED,TRAVEL,TRAVELLING,DANGER,DANGEROUS,PHYSICAL,CONCEPT,CONCEPTS If that's what you want. -Original Message- From: Andrew Curry Sent: 03 September 2007 16:14 To: 'John W. Krahn'; Perl beginners Subject: RE: Regex

RE: marine subroutine

2007-08-30 Thread Andrew Curry
That's rubbish, You can call a sub before you create it as you say. At compile time the entire code is done (bar some exceptions) The issue here is drop the unless you really know what it does my($n); marine(); sub marine { $n += 1; print Hello, sailor number $n!\n; } Works fine.

RE: More Perl and AJAX

2007-08-29 Thread Andrew Curry
Yeah that's fine to use. If you use CGI.pm You can use param('NAME') i.e. if (! param) { # # do something # }

RE: problem connecting to mysql database

2007-08-16 Thread Andrew Curry
Really stupid question but have you installed the mysql client first on the box? The module needs the libraries here to work, they must also be in you paths (LD_LIBRARY_PATH, PATH) -Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: 16 August 2007 08:53 To:

RE: problem connecting to mysql database

2007-08-16 Thread Andrew Curry
To: Andrew Curry; beginners@perl.org Subject: Re: problem connecting to mysql database Hi, May be valid. I am getting superstitious now. Anyway, I have not installed any mysql client.I have simply downloaded InstantRails which has mysql and started the mysql server which is up

RE: One liner to change one line

2007-08-16 Thread Andrew Curry
Why? -Original Message- From: Dr.Ruud [mailto:[EMAIL PROTECTED] Sent: 16 August 2007 09:37 To: beginners@perl.org Subject: Re: One liner to change one line Paul Lalli schreef: s/$h1_sec/$mod_sec/; #replace the pattern found with the modified version Many s/$search/replace/

RE: One liner to change one line

2007-08-16 Thread Andrew Curry
Apologies I miss read the original remark. -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED] Sent: 16 August 2007 10:12 To: Andrew Curry Cc: Dr.Ruud; beginners@perl.org Subject: Re: One liner to change one line On 8/16/07, Andrew Curry [EMAIL PROTECTED] wrote: snip Many s

RE: Emptying several arrays at once

2007-08-15 Thread Andrew Curry
2007 15:08 To: beginners@perl.org Subject: Re: Emptying several arrays at once On Aug 14, 10:17 pm, [EMAIL PROTECTED] (Jeff Pang) wrote: From: Andrew Curry [EMAIL PROTECTED] Whilst you can do by turning off strict and using an array of arraynames and looping over them, its clear concise the way

RE: Recognizing integer as string for if statement

2007-08-14 Thread Andrew Curry
Unless im being very stupid in what your requirements are If(defined $variable $variable ne 0) { } -Original Message- From: Jesse Farrell [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 21:18 To: beginners@perl.org Subject: Recognizing integer as string for if statement Is there a

RE: Emptying several arrays at once

2007-08-14 Thread Andrew Curry
Whilst you can do by turning off strict and using an array of arraynames and looping over them, its clear concise the way you are doing it. I think you could do something like @arrays=('test1','test2','test3'); foreach my $array(@arrays) { @{$array}=(); } But not tested. -Original

RE: run perl as service

2007-08-08 Thread Andrew Curry
To be honest in terms of database monitoring cron is usually the way to go. The advantage Is that then you don't need to monitor the monitoring program. As a DBA you need reliable data in terms of status etc... You could write an overcomplicated daemon which monitors its state but if cron is an

RE: run perl as service

2007-08-08 Thread Andrew Curry
it take over a minute). -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED] Sent: 08 August 2007 13:36 To: Andrew Curry Cc: [EMAIL PROTECTED]; beginners@perl.org Subject: Re: run perl as service On 8/8/07, Andrew Curry [EMAIL PROTECTED] wrote: To be honest in terms of database

RE: String Manipulation

2007-07-31 Thread Andrew Curry
Try if($str5 =~ /\s*(\S+)\s*=\s*(\S+)[,\s*\/*]?/) I cant see how your ([A-Z_]+) Will match your DL_FEM_ADJ1 as this has a number on it? -Original Message- From: Dharshana Eswaran [mailto:[EMAIL PROTECTED] Sent: 31 July 2007 13:17 To: Perl Beginners Subject: String Manipulation

RE: String Manipulation

2007-07-31 Thread Andrew Curry
But in this case it was also not needed as I replied without actually reading the requirements. -Original Message- From: Paul Lalli [mailto:[EMAIL PROTECTED] Sent: 31 July 2007 14:21 To: beginners@perl.org Subject: Re: String Manipulation On Jul 31, 8:40 am, [EMAIL PROTECTED]

RE: perl IDE

2007-07-30 Thread Andrew Curry
Eclipse,vi, gvim etc... Are all plausible for usage, I use vi/gvim but that's only because its what I was taught to use. You use whatever your comfortable with in the end. IDEs help with faster code generation and also help with the standardisation of code, on a large projects they are also very

RE: Html within code

2007-07-26 Thread Andrew Curry
I wouldn't say wrong no, but there are modules out there to make things easier such as the CGI module and multiple others. _ From: Johnson, Reginald (GTI) [mailto:[EMAIL PROTECTED] Sent: 25 July 2007 16:49 To: beginners@perl.org Subject: FW: Html within code Is coding this way

RE: perl-mysql...

2007-07-25 Thread Andrew Curry
You should be able to get your data out using a simple sql query and then display it accordingly. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 25 July 2007 13:34 To: beginners@perl.org Subject: perl-mysql... Hi All, I have this problem of

RE: reading from a file

2007-07-24 Thread Andrew Curry
If you want an over complex solution you could try using use IPC::Open3; use IO::Select; use IO::Handle; i.e. #!/usr/local/bin/perl -w use Data::Dumper; use File::Copy; use IPC::Open3; use IO::Select; use IO::Handle; use strict; use vars qw( $line $select $read $write $error ); (

RE: XML Parsing

2007-06-26 Thread Andrew Curry
XML::LibXML is also a good one for general xml parsing/manipulation. -Original Message- From: mirod [mailto:[EMAIL PROTECTED] Sent: 26 June 2007 08:47 To: beginners@perl.org Subject: Re: XML Parsing On Jun 25, 3:47 am, [EMAIL PROTECTED] (Mike Blezien) wrote: I need to parse a fairly

RE: What is order of retrieving the values from Hash??

2007-06-25 Thread Andrew Curry
There is no order in a hash. I wouldn't call a hash array as its confusing personally. If you require order then you can either add another sort to your hash i.e. make it 3 level with a numerical sort. Or use a list with a list of hashes. You can also use Tie::Hash -Original Message-

RE: Database connection using cfg file

2007-06-22 Thread Andrew Curry
One thing could be [EMAIL PROTECTED]; $usr = @arr[1]; $pwd ||= @arr[2]; They should be $arr[n..] If you turn on strict you can get rid of these as it wont compile until you do. If you take your readcfg. readcfg($cfgpath,\%cfgvalues); sub readcfg {

RE: the Database is not updated

2007-06-21 Thread Andrew Curry
Do you check for the number of rows updated? An update will not throw an error even if no rows are updated, have you tried your values by hand? -Original Message- From: Aruna Goke [mailto:[EMAIL PROTECTED] Sent: 20 June 2007 19:33 To: beginners@perl.org Subject: the Database is not

RE: Problems with arrays

2007-06-20 Thread Andrew Curry
You could do it a couple of ways the way I would go about it is My(@arr1,@arr2,@arr3); mol2_read($opts{m},[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]); sub mol2_read { My($opt_m,$arr1,$arr2,$arr3)[EMAIL PROTECTED]; # # code to do what you want with the above # return; }

RE: Reading a particular line from a file

2007-06-20 Thread Andrew Curry
But that still reads the entire file to that point, You can use seek if you know the number of chars on a line. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 June 2007 13:53 To: beginners@perl.org Subject: Re: Reading a particular line from a file On 20

RE: Array of Array refs

2007-05-30 Thread Andrew Curry
Enough Is enough, can we leave this thread be now. This just puts people off posting questions looking for help in fear of joining some flame war. -Original Message- From: Brian [mailto:[EMAIL PROTECTED] Sent: 29 May 2007 19:30 To: beginners@perl.org; [EMAIL PROTECTED] Subject: Re:

RE: slurping a file

2007-05-10 Thread Andrew Curry
No it wont, not until you close it or the program exits or it goes out of scope and is cleaned up by garbage collection. -Original Message- From: Robert Hicks [mailto:[EMAIL PROTECTED] Sent: 10 May 2007 14:14 To: beginners@perl.org Subject: slurping a file If I do this: open $FH, '',

RE: How to sum up values

2007-04-24 Thread Andrew Curry
Something as crude as use Data::Dumper; open( FILE, ' file' ) || die $!; my ( $line, $ela, $elb, $pre, %count, $i, $tot); $tot = 0; while ( $line = FILE ) { $i++; ( $ela, $elb ) = split ( '\|', $line ); # # remove any white space #

RE: Calling bash things inside perl script.

2007-04-03 Thread Andrew Curry
If you cant rewite them due to constraints etc.. Then just use system or `` depending on if you want to test the return values. -On 4/3/07, Nath, Alok (STSD) [EMAIL PROTECTED] wrote: Hi, Before starting my problem I just want to thank all the active members who had literally

RE: Not an ARRAY reference. Problems reading a simple XML file

2007-04-02 Thread Andrew Curry
If you look at $data for the problem file its not an array at that point. For a single element XML::Simple doesn't display your data in a list i.e. With 1 element of record. $VAR1 = { 'RECORD' = { 'COLLNAME' = 'FBIS2004', 'DOCI' = 'CP1'

RE: how to redirect warnings to a file

2007-03-22 Thread Andrew Curry
./script.pl 2 err in unix. Or print STDERR error message in your program. -Original Message- From: lakshmi priya [mailto:[EMAIL PROTECTED] Sent: 22 March 2007 08:16 To: beginners@perl.org Subject: how to redirect warnings to a file Hi, How do I redirect the warning messages