Re: Subroutine returning 2 arrays

2006-10-12 Thread Mumia W.
On 10/12/2006 10:55 AM, Gallagher, Tim F (NE) wrote: From a subroutine I would like to return 2 separate arrays like this sub TEST { @a = ("a1","a2","a3","a4","a5","a6","a7"); @b = ("b1","b2","b3","b4","b5","b6","b7"); return (@a, @b); } my(@lala,@baba) = TEST; print @lala; The probl

Re: Modules for printing the content of an array

2006-10-11 Thread Mumia W.
On 10/11/2006 10:42 AM, Sami FANTAR wrote: [...] I have read the Data::Dumper related doc. Including the part where it tells you how to substitute the correct variable names for $VAR1,$VAR2,... ? But, after having written your example, the output seems quite weird. I got $VAR1,$VAR2, and so

Re: Large DBI query filling up memory

2006-10-07 Thread Mumia W.
On 10/07/2006 04:11 AM, Robin Sheat wrote: I have the following to open a database: my $dbh = DBI->connect("DBI:$dbconn", $dbuser, $dbpass) or die "Couldn't connect to db $dbconn:" . DBI->errstr; and then later I'm doing: my $query="select user_id, preference from $opt{table}";

Re: Can't get Sudo.pm to run my command but it works from a prompt

2006-10-05 Thread Mumia W.
On 10/05/2006 07:10 PM, RICHARD FERNANDEZ wrote: From: Mumia W. [mailto:[EMAIL PROTECTED] Does the webserver have the proper permissions to invoke that sudo entry? AFAIK, yes. I don't think it would be asking for a password if it couldn't run the binary. It just doesn't see

Re: Can't get Sudo.pm to run my command but it works from a prompt

2006-10-05 Thread Mumia W.
On 10/05/2006 03:23 PM, RICHARD FERNANDEZ wrote: if the user has never signed in and the admin never ran passwd user passwd -f user and then that user never went into make his/her password permenant then yes it would matter b/c the passwd is not set. I've gone in and set a passwd for the u

Re: an easy way to know if a module is installed or not

2006-10-05 Thread Mumia W.
On 10/05/2006 11:34 AM, Johnson, Reginald (GTI) wrote: To piggy back off of this question... Is there a way to just list out the modules you have installed? Make sure that perldoc is installed on your system and do this at a command prompt: perldoc -q installed -- To unsubscribe, e-mail:

Re: Cleaning smart quotes, etc from data pasted to a form

2006-10-05 Thread Mumia W.
On 10/05/2006 09:48 AM, Chad Perrin wrote: On Thu, Oct 05, 2006 at 09:06:11AM -0500, Mumia W. wrote: On 10/05/2006 08:47 AM, Kevin Old wrote: Hello everyone, I have a set of web based admin tools that users in my company use to update various pieces of a website. I've never been ab

Re: Cleaning smart quotes, etc from data pasted to a form

2006-10-05 Thread Mumia W.
On 10/05/2006 08:47 AM, Kevin Old wrote: Hello everyone, I have a set of web based admin tools that users in my company use to update various pieces of a website. I've never been able to write enough regexes, "clean routines", etc. to clean out all of the "bad characters" that users put in. Th

Re: Smart assignment

2006-10-03 Thread Mumia W.
On 10/03/2006 11:37 AM, Derek B. Smith wrote: returns "true" or "false" (1 or '') and in list context it returns the contents of any capturing parentheses in the pattern. The expression: ( $ptypeline =~ /movable.+(sine|geo|radial|ortho)/i )[ 0 ] is a list slice so the regular expression is in

Re: Smart assignment

2006-10-02 Thread Mumia W.
On 10/02/2006 01:54 PM, Rob Dixon wrote: Bryan R Harris wrote: ** $ptypeline = "#movableortProjortho0.0000.000"; ($ptype) = ($ptypeline =~ /movable.+(sine|geo|radial|ortho)/i) || "(missing)"; print $ptype, "\n"; ***

Re: can someone help out?

2006-10-01 Thread Mumia W.
On 10/01/2006 04:27 AM, Goke Aruna wrote: Dear all, I am just learning perl. i have the following code #!c:/perl/bin/perl -w use warnings; use strict; my $file = 'C:/Perl/20060920_1.csv'; open FH, $file or die $!; while(defined($file=)){ my @file = split/,/, $file; print qq($file[0], $file

Re: question about web site interaction script

2006-09-29 Thread Mumia W.
On 09/29/2006 04:08 PM, Alexander Sirotkin wrote: What is the best module to use when writing web site interaction scripts ? The script would have to login sending username and password and after that follow a few links and do some more "http posts". Any suggestions ? Thanks WWW::Mechanize

Re: Problem dynamically sign array a name

2006-09-29 Thread Mumia W.
On 09/29/2006 02:24 PM, Shiping Wang wrote: Hi Charles, At 13:08 2006-9-29, Charles K. Clarkson wrote: Shiping Wang wrote: : Hi, I have a big array, I need re-arrange it then put into sub : array, after that do something on each sub array. How do you want to split it into sub arrays? Like

Re: using local when appropriate

2006-09-29 Thread Mumia W.
On 09/29/2006 01:28 PM, Charles K. Clarkson wrote: Derek B. Smith wrote: : ## Below is better pratice ## : : sub getfile { : my $filename = shift; : open F, "< $filename" or die "open failed $!" : my $contents; : { local $/ = undef; # Read entire file at once :$contents = ; # Retur

Re: interpoliation within regexp

2006-09-29 Thread Mumia W.
On 09/29/2006 01:44 PM, Rob Dixon wrote: Derek B. Smith wrote: --- "Mumia W." <[EMAIL PROTECTED]> wrote: What is the purpose of this program? To generate a random 6 character string. If the first character starts with a # then I just ignore the new string and tell it to

Re: interpoliation within regexp

2006-09-29 Thread Mumia W.
On 09/29/2006 12:15 PM, Derek B. Smith wrote: --- "D. Bolliger" <[EMAIL PROTECTED]> wrote: Derek B. Smith am Donnerstag, 28. September 2006 22:28: Why not just specify a non-digit for the first character: my @a = ( 0 .. 9, 'a' .. 'z', 'A' .. 'Z'); my $password = join '', $a[ 10 + rand( @a -

Re: Problem dynamically sign array a name

2006-09-29 Thread Mumia W.
On 09/29/2006 11:49 AM, Shiping Wang wrote: Hi, I have a big array, I need re-arrange it then put into sub array, after that do something on each sub array. I have a problem to dynamically give sub array a name. Any help? Maybe I should use anonymous array? Thanks, Shiping Here is my code:

Re: interpoliation within regexp

2006-09-28 Thread Mumia W.
On 09/28/2006 12:04 PM, Derek B. Smith wrote: ** The input data is a 6 character randomized string that could start with a # such as 6FhJ9Z. If it does start with a number then I need to convert this character into its cooresponding alpha char, [a-z,A-Z].

Re: interpoliation within regexp

2006-09-28 Thread Mumia W.
On 09/28/2006 08:16 AM, Derek B. Smith wrote: --- "Derek B. Smith" <[EMAIL PROTECTED]> wrote: I need to substitute a conversion using chr, but have failed on multiple attempts. Basically if the first element contains a # then convert it. Will anyone advise? thank you derek #if first char is

Re: Standard input Question

2006-09-26 Thread Mumia W.
On 09/26/2006 07:10 AM, elite elite wrote: If i going to write a script with a standard input how would it look like?My perl book don't talk about it. Craig If the perl documentation has been properly installed onto your computer, you should be able to open a command prompt and type "perld

Re: Matching a sub pattern and processing results

2006-09-25 Thread Mumia W.
On 09/25/2006 06:47 AM, John W. Krahn wrote: Mumia W. wrote: On 09/24/2006 07:04 PM, David Gilden wrote: I am having a little trouble understanding matching and getting the sub pattern saved to a Var. so that I can do a munge. I want to take the line returns and change them into pipe

Re: Matching a sub pattern and processing results

2006-09-25 Thread Mumia W.
On 09/24/2006 07:04 PM, David Gilden wrote: Greetings, I am having a little trouble understanding matching and getting the sub pattern saved to a Var. so that I can do a munge. I want to take the line returns and change them into pipe characters '|' All data records start with a date i.e. 0

Re: about perltoot

2006-09-24 Thread Mumia W.
On 09/24/2006 12:35 PM, chen li wrote: --- "Mumia W." <[EMAIL PROTECTED]> wrote: On 09/22/2006 07:50 AM, chen li wrote: --- "Mumia W." <[EMAIL PROTECTED]> wrote: That "redundancy" allows you to use inheritance. If you have a class Employee, wi

Re: selecting a part of a string

2006-09-23 Thread Mumia W.
On 09/23/2006 07:07 PM, Rob Dixon wrote: [...] If you want to do what you said, and put everything up to the pipe into a variable (scalar $tex?) then /([^|]+)/; $tex = $1; [...] No, you should always only use the match variables after you've determined that the match was successful: /^(

Re: CGI: How do I populate a form field based on the value entered in a different field

2006-09-23 Thread Mumia W.
On 09/23/2006 01:21 PM, RICHARD FERNANDEZ wrote: Hi folks, I'm trying to create an HTML form that will refresh itself based on user input. In the POD for CGI it says that you can set the value of a named parameter by using something like: $query->param(-name=>'foo', -value=>'the value'); B

Re: AUTOLOAD in perltoot

2006-09-22 Thread Mumia W.
On 09/22/2006 08:30 AM, chen li wrote: Hi all, I copy some codes from perltoot and write some lines to see how AUTOLOAD works. test.pl #!C:/Perl/bin/perl.exe use strict; use warnings; use Data::Dumper; use Person; my $obj=Person->new(); print $obj->name(); p

Re: about perltoot

2006-09-22 Thread Mumia W.
On 09/22/2006 07:50 AM, chen li wrote: --- "Mumia W." <[EMAIL PROTECTED]> wrote: That "redundancy" allows you to use inheritance. If you have a class Employee, with an expanded set of fields, this method makes it possible to add the fields without having to modify e

Re: problem with stat?

2006-09-22 Thread Mumia W.
On 09/22/2006 02:58 AM, Mathew Snyder wrote: [...] my $mod_time = (stat($file))[9]; [...] If $file is not in the current directory, this won't work. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: about perltoot

2006-09-22 Thread Mumia W.
On 09/21/2006 07:08 PM, chen li wrote: Hi all, I read some sections in perltoot. In section Autoloaded Data Methods I see some line codes as following: package Person; use Carp; our $AUTOLOAD; # it's a package global my %fields = ( name=> undef,

Re: PACK statement compile error

2006-09-21 Thread Mumia W.
On 09/21/2006 10:25 AM, Tony Frasketi wrote: Hello list. I'm getting the following error message when compiling the program listed below ... Bad name after c' at /test/test1.cgi line 22. line 22 is ' s/%(..)/pack('c', hex($1))/eg;' Need help in eliminating this error! thnx tony ===

Re: system call issues

2006-09-21 Thread Mumia W.
On 09/21/06 07:30, Mumia W. wrote: Try the open command I wrote, and see if that works. I hope this helps. s/open command/code/ No I didn't write the open command ;-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.

Re: system call issues

2006-09-21 Thread Mumia W.
On 09/21/2006 04:52 AM, Saurabh Singhvi wrote: Hi all, The following code block is written without strictures and warnings enabled. If you place these lines, use strict; use warnings; at the top of your program, you'll catch errors much more quickly. In particular, "use strict" will fo

Re: Modules aiming at displaying mathematical functions on screen?

2006-09-20 Thread Mumia W.
On 09/20/2006 05:24 AM, SFantar wrote: Hello After searching the cpan.org site for mathematical modules, I did not find a module which can display graphically the result of a function. I want to see a function curve displayed in a graphical window? How can I make it possible in Perl? Thanks i

Re: File::find with no_chdir

2006-09-19 Thread Mumia W.
On 09/18/2006 10:11 AM, Emilio Casbas wrote: Hi, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\&wanted, @ARGV); sub wanted { print "$File::Find::name\n" if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search

Re: changing the group that files are created with

2006-09-18 Thread Mumia W.
On 09/18/2006 02:06 AM, Ken Foskey wrote: I have a lot of files created by a (much too) complex script and the user I am running with has a default group of 'staff' but I want all files created to have grp which we create to ensure that only authorised people have access to a particular clients d

Re: How to create XML files from simple plain text files?

2006-09-15 Thread Mumia W.
On 09/15/2006 07:12 AM, sfantar wrote: Hello All! I would like to know how possible it is to create XML files from plain text files. I have a huge number of text files I want to convert into XML format. Is there any Perl modules for this purpose? [...] XML::Simple can do it. -- To unsubscr

Re: Problem with GD::Graph

2006-09-15 Thread Mumia W.
On 09/15/2006 02:24 AM, john wrote: Hi all I have installed the GD::Graph module and I tried to run the example using this code [...] my $graph = GD::Graph::chart->new(400, 300); [...] I haven't installed GD::Graph yet, but the description provided by 'aptitude' doesn't describe a GD::Gr

Re: removing characters

2006-09-15 Thread Mumia W.
On 09/15/2006 12:54 AM, ubergoonz wrote: Hi, I have a certain variables of emplyee number which comes in the format of [a000] or [u000] {whereby 000 is some serial numbers}. I would like to remove the enclosed [ & ] see if it is belong to class a or u , i can do it as follow $v

Re: extracting several text from logs using regex

2006-09-15 Thread Mumia W.
On 09/14/2006 11:04 PM, Michael Alipio wrote: Hi, A log file contains several of these lines: session.blablahbla blablabla proto:6 blablabla srcip:90.0.0.1 blablabla blablabla srcport:3243 blablabla dstport:23 blablabla session.blablahbla blablabla proto:6 blablabla srcip:90.0.0.1 blab

Re: bizarre fractional exponents math

2006-09-14 Thread Mumia W.
On 09/14/2006 06:47 PM, Bryan R Harris wrote: Can someone explain this behavior? % perl -e 'print -12.17**0.2, "\n"' -1.64838295714428 % perl -e 'print (-12.17)**(0.2), "\n"' -12.17% perl -e 'print ((-12.17)**(0.2)), "\n"' nan% Yes, the "\n" isn't getting printed for some reason on the 2nd tw

Re: Archive::Zip and hash issues

2006-09-14 Thread Mumia W.
On 09/14/2006 09:20 AM, Derek B. Smith wrote: [...] sub zipit { ##-- Add all readable files below $oldir --## ##-- and write them into a file. --## my $zip = Archive::Zip->new(); my $entry = $zip->addDirectory ("$oldir/$word/") or die "Failed to add file for archive zip $!"; $entry->de

Re: hash access

2006-09-14 Thread Mumia W.
On 09/14/2006 07:17 AM, John W. Krahn wrote: Mumia W. wrote: The "my" command doesn't work that way. You have to "my" the entire hash like so: ... my $abreviatures; That is not a hash, that is a scalar. ITYM: my %abreviatures; John Oops, thanks :-) -- To un

Re: hash access

2006-09-14 Thread Mumia W.
On 09/14/2006 01:18 AM, Xavier Mas i Ramón wrote: Hi all!, I'm trying to create a sorted (ASCII) hash file but get all time a syntax error in line "my $abreviatures{$clau} = 1;" at "$abreviatures{ <--". Sure is an stupid mistake but I'm not able to see it even checking with my "Learning Perl

Re: Command line vs. cron

2006-09-13 Thread Mumia W.
On 09/13/2006 06:07 PM, James Marks wrote: What turned out to work — although I haven't figured out why yet — is to to use 'acx' rather than 'aux' and to include that within the single quotes as in: open PS, '-|', '/bin/ps acx' or die "Cannot open pipe from ps: $!"; The above line results i

Re: Command line vs. cron

2006-09-12 Thread Mumia W.
On 09/12/2006 11:28 PM, James Marks wrote: Hi folks, I don't know if this is a Perl or UNIX problem and I'm hoping you can help me figure that out. I wrote a script that checks to see if the httpsd and mysqld processes are running on my server and to log the results of those tests. When I

Re: Downloading a file through a filehandle

2006-09-12 Thread Mumia W.
On 09/11/2006 05:58 PM, Robin Sheat wrote: On Tuesday 12 September 2006 10:27, Rob Dixon wrote: [...] What may help is that LWP allows for a callback to be specified in the get() call, so that the downloaded data can be passed in chunks to a user-written subroutine as it arrives. Use $agen

Re: Position Weight Matrix of Set of Strings with Perl

2006-09-06 Thread Mumia W.
On 09/06/2006 05:41 AM, Mumia W. wrote: On 09/06/2006 04:02 AM, Wijaya Edward wrote: Dear Experts, I am looking for a really efficient way to compute a position weight matrix (PWM) [...] Although I'm sure that smarter posters than I will [...] do it right. Ugh, I forgot about Wij

Re: regular expression question

2006-09-06 Thread Mumia W.
On 09/06/2006 09:49 PM, chen li wrote: Hello all, I need a regular expression to process some data but get stuck. I wonder if anyone here might have a clue. input: my $line='group A 1 2 3 4';# separated by space results: my @data=("group A ",1,2,3,4); As Adriano Ferreira said, you don

Re: Position Weight Matrix of Set of Strings with Perl

2006-09-06 Thread Mumia W.
On 09/06/2006 04:02 AM, Wijaya Edward wrote: Dear Experts, I am looking for a really efficient way to compute a position weight matrix (PWM) from a set of strings. In each set the strings are of the same length. Basically PWM compute the frequency (or probabilities) of bases [ATCG] occur in eac

Re: word counting

2006-09-05 Thread Mumia W.
On 09/05/2006 03:47 AM, Andrew Kennard wrote: Hi all I'm looking for a good word counting module/sub routine I've found this so far http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=562&lngWId=6 but it counts things like the "Item1,Item2,Item3" as one word I've had a searc

Re: can't print to STDOUT on 5.8.4

2006-09-05 Thread Mumia W.
On 09/05/2006 12:50 AM, Michael Alipio wrote: Hi, I was running this command on my perl program, open FLOWTOOLS, "|/usr/bin/flow-cat $start | /usr/bin/flow-nfilter -f filter.tmp -F $direction |/usr/bin/flow-stat -Pf8 | le ss" or die $!; It does output something on the screen when I run it on F

Re: process data into an array using CGI script

2006-09-02 Thread Mumia W.
On 09/02/2006 08:09 PM, chen li wrote: Dear all, I paste some data into textarea in a CGI script and use param('data')to retrieve the data. I want to pass the data into an array but what I find is that I only one dimensional array. Can someone here give me a hand? Thanks, Li data pasted into

Re: Totally lost - need a starting point

2006-08-31 Thread Mumia W.
On 08/31/2006 08:24 AM, Helen wrote: - Original Message - From: "Charles K. Clarkson" <[EMAIL PROTECTED]> To: Sent: Wednesday, August 30, 2006 10:16 PM Subject: [Bulk] RE: Totally lost - need a starting point Helen wrote: I am starting from scratch again reading the manual more comp

Re: Trouble with variable scoping

2006-08-31 Thread Mumia W.
On 08/31/2006 08:19 AM, Roman Daszczyszak wrote: In my perl script, I have a "global" variable called @excludedIPAddresses, [...] my @excludedIPAddresses = qw# 192.168.0.142 192.168.3.118 #;# [...] local @excludedIPAddresses = @excludedIPAddresses; [...] When I run this, I get an error "

Re: Can't create 2d array in Perl

2006-08-29 Thread Mumia W.
On 08/29/2006 07:01 PM, Gregg Allen wrote: Hi: I would like to read a tab delimited text file created in Excel into a 2d array. I don't understand why the following doesn't work. The $i and $j, along with the print statement, are only for debugging purposes. It prints: Can't use string

Re: splitting strings

2006-08-29 Thread Mumia W.
On 08/29/2006 05:02 PM, Dr.Ruud wrote: "Mumia W." schreef: Hien Le: [...] # Method 2 print( "\nMethod 2\n" ); my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces ?!? [...] The comments made by Dr. Ruud and John W. Krahn are correct. Split is returni

Re: Print to new file for each results

2006-08-29 Thread Mumia W.
On 08/29/2006 06:32 PM, Ron McKeever wrote: I am try to use part of someones elses code that creats the data file which prints out like this: ip|result|deptA|data ip|result|deptB|data ip|result|deptC|data My goal instead of having all the data in one big file is to loop this and create a file

Re: splitting strings

2006-08-29 Thread Mumia W.
On 08/29/2006 06:52 AM, Hien Le wrote: [...] # Method 2 print( "\nMethod 2\n" ); my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces ?!? [...] The comments made by Dr. Ruud and John W. Krahn are correct. Split is returning the empty strings between delimiter segments in the ori

Re: help with awk command in perl

2006-08-29 Thread Mumia W.
On 08/29/2006 10:40 AM, Sayed, Irfan (Irfan) wrote: Hi All, I have a following script in perl in which i am using awk command but it is not getting executed properly. # /usr/atria/bin/Perl -w use strict; use warnings; my $fname = "/tmp/checkvob_log"; open(FILE,">>$fname"); Check

Re: hash lookup table

2006-08-29 Thread Mumia W.
On 08/29/2006 01:46 PM, Derek B. Smith wrote: [...] If I change $number to $word is obviously does the copy correctly, but what is the point of my $number = $subdir_for{$word}; ??? Forget it. Do what works. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: Cgi with GD grap, and displaying graphs

2006-08-29 Thread Mumia W.
On 08/29/2006 11:05 AM, Patrick Rice wrote: Hi all I'd like some advice, set up; Red hat Enterprise 4 Perl 5.8 I am trying to create a web page, which takes data from a file and builds a graph with GD, these are then saved as pictures, I then use the cgi script to call the pics using dynamic

Re: STDOUT and STDERR to same file

2006-08-29 Thread Mumia W.
On 08/29/2006 09:06 AM, Ken Foskey wrote: I have a daemon process that works but I am currently running it with script.pl > error.log 2>&1 and I want to do the same thing without using the redirection,, remove the human error when starting the program. I can `open( STDERR, '>', 'error.log') .

Re: split function help

2006-08-29 Thread Mumia W.
On 08/29/2006 08:23 AM, Sayed, Irfan (Irfan) wrote: Hi All, I need to use the split function in perl script. * /vobs/apache_log4j /usr/add-on/puccase_vob01/ccvob01/apache_log4j.vbs public (replicated) Above line i need to split in following order * /vobs/apache_log4j /usr/add-on/puccase

Re: hash lookup table

2006-08-28 Thread Mumia W.
On 08/28/2006 08:37 AM, Derek B. Smith wrote: All, I am trying to run logic that will copy/delete 3 versions of log.\d+ files to their respective directories. Because there are so many directories, I have built a hash table instead of using a bunch of "if else conditions" with reg exps. [

Re: additonal notes - to: subroutine in LWP - in order to get 700 forum threads - some explanations

2006-08-26 Thread Mumia W.
On 08/26/2006 10:57 AM, jobst müller wrote: [...] first of - i have to explain something; I have to grab some data out of a phpBB in order to do some field reseach. I need the data out of a forum that is runned by a user community. I need the data to analyze the discussions. Use LWP::*

Re: Using a regular expression to remove all except certain characters.

2006-08-25 Thread Mumia W.
On 08/25/2006 04:26 PM, Jim Schueckler wrote: Hi, I need to remove all characters from a string except 'a'..'z', 'A'..'Z', and '0'..'9'. [...] $newstring = $oldstring; $newstring =~ s/[^[:alnum:]]+//g; Everything that's not alphanumeric gets zapped to nothing. HTH -- To unsubscribe, e-mail

Re: CGI redirect question, slightly OT

2006-08-25 Thread Mumia W.
On 08/25/2006 02:58 PM, Michael Weber wrote: Greetings, perlers! Greetings, Michael. [...] # Now that we're done, redirect the user to an "all done" page... print "Location: file:///Y:/Public_Info/IS/whitelist_done.html\r\n\r\n"; You can only redirect to web-servers. Redirection to locat

Re: is there a path enviroment parameter that can tell perl where to find files?

2006-08-23 Thread Mumia W.
On 08/23/2006 02:30 PM, zhihua li wrote: Dear all, now when I'm writing some perl script that needs to open some files, I alwayse have to put the script in the same directory of these files, or I'll have to give the full path to these files in my script. if I do not do so, perl wouldn't be ab

Re: How to grep $string from a file? How to run sed-like commands from Perl?

2006-08-23 Thread Mumia W.
On 08/23/2006 05:09 PM, [EMAIL PROTECTED] wrote: [...] Am guessing that I have to take out the array bit and just modify this line here: @match=grep{/$lookfor/[EMAIL PROTECTED]; But I am not sure how or what I should change it to. How do I tell grep to search from a file instead of from an arra

Re: How to do this sed one-liners inside Perl?

2006-08-23 Thread Mumia W.
On 08/23/2006 04:43 PM, [EMAIL PROTECTED] wrote: Hi all, I found the following sed one-liner trick that strips out the spaces that I run as follows: sed 's/^[ \t]*//;s/[ \t]*$//' /tmp/file.txt > /tmp/filea.txt [...] It's pretty much exactly the same except for the "-pe": perl -pe 's/^[ \t]*/

Re: Intersection for each pair of arrays

2006-08-23 Thread Mumia W.
On 08/23/2006 09:58 AM, Andrej Kastrin wrote: Hi, below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. You could turn your code into a function and call it f

Re: Accessing TCL api via perl

2006-08-23 Thread Mumia W.
On 08/23/2006 01:03 AM, Bobby Jafari wrote: [...] Every TCL API instruction that I use, would create a handle of some sort (i.e. a value that can be use to destinguish the call in a unique fashion). [...] I don't know what you mean by this. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: How do I do this on Perl ...

2006-08-22 Thread Mumia W.
On 08/22/2006 11:24 PM, [EMAIL PROTECTED] wrote: Hi all, I used to do this on UNIX scripts ... #!/usr/bin/ksh vowels="a e i o u" for letter in $vowels do echo $letter done How do I do the same in Perl? Is it possible to do this in Perl without having to put vowels into an array and use for

Re: XML::Simple help request

2006-08-22 Thread Mumia W.
On 08/21/2006 11:32 PM, Owen Cook wrote: I am trying to get email addresses out of a Sylpheed address book. The output of Dumper is; $VAR1 = { 'attribute-list' => [ {} ], 'first-name' => '', 'uid' => '1581494

Re: Simple-Yet Trivial Problem - Copy files from directory

2006-08-19 Thread Mumia W.
On 08/19/2006 02:19 AM, I BioKid wrote: I have a simple - yet trivial problem - I 2000 directory at /home2/foo/foodir/ . I need to copy all files with extension *.atm and *.ali to another directory called temp (say /home2/foo/foodir/temp ) After that I need to run a program in each of this di

Re: Designing forms/tables in CGI

2006-08-18 Thread Mumia W.
On 08/18/2006 08:23 AM, Nath, Alok (STSD) wrote: Hi Guys, My question is can I create more that one form in the same page. Yes If yes , do I need to create separate cgi object for each form or one object for one page is sufficient.How do I design ? Which is advised ? On

Re: Comparing two files of 8million lines/rows ...

2006-08-16 Thread Mumia W.
On 08/16/2006 04:35 PM, [EMAIL PROTECTED] wrote: Hi all, I have two database tables, one is local and one is on a WAN. They are supposed to be in-sync but they at the moment, they are not. There are 8million+ plus rows on this table. I tried to do SELECT EMPNO FROM EMP WHERE EMPNO NOT IN ( SELE

Re: Improving script listing Perl modules installed

2006-08-15 Thread Mumia W.
On 08/14/2006 06:54 PM, SFantar wrote: Hello everyone I want to list all the Perl modules installed on my system. The script below does it well. Unfortunately, it displays the name of each installed Perl module twice. How can I get rid of them? [...] For me it only displays each module once.

Re: extracting NAME and DESCRIPTION sections from pod text file

2006-08-13 Thread Mumia W.
On 08/13/2006 08:36 AM, Ken Perl wrote: what's correct regular expression on extracting only NAME and DESCRIPTION section from pod text file? I have tried this, but failed! perl -e '$c=`pod2text /data/WebGUI/lib/WebGUI/User.pm`;$c =~ s/(NAME.*)SYNOPSIS/$1/;print $c' foreach $_ (`pod2text /usr

Re: Dynamic variables - from INI files ...

2006-08-12 Thread Mumia W.
(Re-directed to the list) On 08/12/2006 05:44 AM, [EMAIL PROTECTED] wrote: Hi Mumia, Thanks for your tip, that's a good one ... just need to make some more modifications as below: if ($path =~ m/\Q$ini{"SOURCE_DIR$count"}\E/i) { $TARGET_DIR = $ini{"TARGET_DIR$count"}; } else { $TARGET_DI

Re: How to search/match a variable pattern

2006-08-11 Thread Mumia W.
On 08/11/2006 11:50 PM, [EMAIL PROTECTED] wrote: Hi John, Thanks for a very quick response John. It gives the error as below: Trailing \ in regex m/D:\STUDY\PERL\MYFTP\/ at D:\Study\Perl\MyFtp\Ftp1.pl line 109. ($base,$path,$type) = fileparse($ARGV[0]); $pattern=$path; print "matches" if $s

Re: Dynamic variables - from INI files ...

2006-08-11 Thread Mumia W.
On 08/11/2006 09:37 PM, [EMAIL PROTECTED] wrote: Hi, I am writing a Perl script that reads some kind of INI file. I cannot use Config::INI or install any new modules due to some restriction so am reading the whole INI text file one line at a time and storing them into an array. Here are what on

Re: Hide code and user interfaces

2006-08-11 Thread Mumia W.
On 08/11/2006 10:51 AM, Kevin Viel wrote: [...] Second, is there a way to keep my code private, like providing only the compiled program? [...] I did a search on CPAN for "Obfuscate," and PAR::Filter::Obfuscate was returned. It's possible that PAR from CPAN is what you need. -- To uns

Re: Multiple matching question

2006-08-10 Thread Mumia W.
On 08/10/2006 09:12 AM, Roman Daszczyszak wrote: Hello all, I have several text files with a few thousand contacts in each, and I am trying to pull out all the contacts from certain email domains (about 15 of them). I wrote a script that loops through each file, then loops through matching e

Re: reading line by line

2006-08-09 Thread Mumia W.
On 08/09/2006 11:15 AM, Octavian Rasnita wrote: Hi, I have a program that contains a pretty big block of text: my $text = <), but the program contains 2 blocks of text. Is there a solution for this? There are two solutions I can think of. You can open an "in memory" variable (see perldoc -

Re: Trouble simplifying hash of array access

2006-08-08 Thread Mumia W.
On 08/08/2006 12:12 PM, n[ate]vw wrote: I'm having some trouble using a hash of arrays. I thought I was starting to understand the jumbled mass of variable use in Perl, but perhaps not... Instead of the missing switch() statement, I'm using a hash set up like this: %zone_info = ( 'EST' =>

Re: POD rendering - was Re: POD: force line break?

2006-08-08 Thread Mumia W.
On 08/08/2006 04:19 AM, Gary Stainburn wrote: [ snipped ] What's the best way to force the formatting similar to the original layout? Did you read the perlpod document (perldoc perlpod)? Did you read Ken Foskey's response in the thread? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: Linux

2006-08-08 Thread Mumia W.
On 08/07/2006 06:57 PM, Ryan Dillinger wrote: Hello All, I just recently loaded linux onto my laptop. I hope this was not a bad move. But I cannot find the Activstate Perl I downloaded.I am using openSUSE Linux. I also am having trouble deciding which is the command line to open my scripts. T

Re: string to perl

2006-08-07 Thread Mumia W.
On 08/07/2006 03:12 AM, Ryan Perry wrote: I have a string I want to pass to another function and I want that function to evaluate it as perl code: [...] perldoc -f eval -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help with probably dumb question

2006-08-06 Thread Mumia W.
On 08/06/2006 09:43 PM, Ralph H. Stoos Jr. wrote: [...] So, what I really want, is to have the script re-entrant so that I can get one file as output, and then use all the resultant files as a base to further parse. Pardon my blathering explanation, but can I do this ?? Do I need to make the

Re: form submission through proxy

2006-08-06 Thread Mumia W.
On 08/06/2006 01:15 AM, Saurabh Singhvi wrote: Hi all [...] Hello use lwp::UserAgent; [...] I am using the above code to submit a form. Is it correct ?? I can't test it as I am behind proxy. So I need a way make the code do the requests through a proxy. The $ variables are being passed

Re: Regex...HTML::Parser...Getting webpage data?

2006-08-05 Thread Mumia W.
On 08/04/2006 02:25 PM, Wesley Bresson wrote: Thanks for your example script using HTML::Treebuilder, however I'm trying to figure out why it appears to grab some items but not others. [...] What appears to grab some items but not others? You didn't show anyone your program, so how can they

Re: Regex...HTML::Parser...Getting webpage data?

2006-08-04 Thread Mumia W.
On 08/03/2006 01:27 PM, Wesley Bresson wrote: I'm pretty new to Perl, my past experience has been in modifying other peoples code in order to do what I want it to do but now I'm trying to write my own to do a specific task that I can't find code for and am having issues. I am trying to retrieve

Re: reg-ex match - reverse looking assertion?

2006-08-04 Thread Mumia W.
On 08/04/2006 04:26 AM, Paul Beckett wrote: I'm trying to pattern match the beginning of a SQL string like: INSERT INTO `rwikiobject` VALUES ('0b5e02f308c5341d0108fca900670107','2006-03-06 23:36:41','/site/ec07580d-1c66-469f-80be-c0afd616cedf/alembert, d \'','/site/ec07580d-1c66-469f-80be-c0afd61

Re: Web page manipulation

2006-08-03 Thread Mumia W.
On 08/03/2006 07:37 PM, Eric Krause wrote: Hello all, I am new to perl and I am trying to write a script that will allow me to automate some tasks that I do every day on the same web pages. Can anyone give me some quick examples to get web page data and pass data back to the pages? Sorry if

Re: smash and grab

2006-08-03 Thread Mumia W.
On 08/03/2006 10:58 AM, Tim Wolak wrote: Hi All, I'm working on a bit of code to parse a logfile, grab the IP's and put them in the deny file. In the beginning of my code I'm grabbing all the IP's in the deny file, putting them in an array to check against later to make sure that IP is not alre

Re: file help

2006-08-02 Thread Mumia W.
On 08/02/2006 10:39 AM, Sayed, Irfan (Irfan) wrote: Hi All, Following is the code which i am executing but i am not getting the output of command my $out = system($cmd); into the file. Plz help. Regards Irfan. #/usr/atria/bin/Perl -w use strict; use warnings; my $CT = "/usr

Re: if-clause again

2006-08-01 Thread Mumia W.
On 08/01/2006 08:13 AM, Dr. Claus-Peter Becke wrote: databaserequest_noun($col, $table, $case) is a self written function based on the dbi manual's proposals. here's the code: sub databaserequest_noun { my ($col,$table,$case) = @_; my $database = "lexikon"; my $hostname = "localhost"; my $dsn

Re: if clause

2006-07-31 Thread Mumia W.
On 07/31/2006 11:29 AM, Dr. Claus-Peter Becke wrote: Mumia W. schrieb: On 07/31/2006 07:20 AM, Dr. Claus-Peter Becke wrote: dear mumia w, thank for your support. as you supposed the values aren't equal. the subroutine's argument is "1". had databaserequest_noun been i

Re: if clause

2006-07-31 Thread Mumia W.
On 07/31/2006 03:45 AM, Dr. Claus-Peter Becke wrote: dear members, using a subroutine's resulting argument in an if-clause i compare this string with another term. but although each of the term has the value of the other i don't achieve the result i'm looking for. if (($Q::partofspeech eq 'n

<    1   2   3   4   >