RE: While loop, confused...

2003-07-02 Thread Shishir K. Singh
Hi all! I have this while loop in my script: while (($type ne Windows) || ($type ne Linux)) { print Enter TYPE of server to build. Linux or Windoze [linux, windows]:\n; $type = STDIN; chomp $type; $type =~ tr/a-z/A-Z/; if (($type eq LINUX) || ($type eq L)) { $type = Linux; } if (($type eq

RE: Regex problem

2003-06-25 Thread Shishir K. Singh
Hi All - This script: use strict; use warnings; my $string = 'I love c++'; my $compare = 'some compare string'; if ($compare =~ /$string/) { print $compare contains $string\n; } else { print $compare does not contain $string\n; } gives this error: Nested quantifiers in regex; marked

Help needed

2003-06-24 Thread Shishir K. Singh
Hello, I have to get the size and last modified date of a remote file via URL without reading in the whole file. I have gone through LWP::UserAgent but couldn't make much headway. Any pointers on how to do it would be appreciated. TIA Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED]

How do I find URL file size/last modified date

2003-06-24 Thread Shishir K. Singh
Hello, I have to get the size and last modified date of a remote file via URL without reading in the whole file. I have gone through LWP::UserAgent but couldn't make much headway. Any pointers on how to do it would be appreciated. TIA Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Win32::OLE

2003-06-18 Thread Shishir K. Singh
Hello, I am running Active state Perl 5.8.0 on Windows 2000 Professional. I am trying to run simple script that tries to parse an XLS file. The script name is x.pl and the xls file that it tries to open is x.xls and they both exist in the same directory. x.pl #

Info req

2003-06-17 Thread Shishir K. Singh
Hello, I am trying to locate the perl code for the opcode -B or stat but I am getting lost in the maze of all the files. Would appreciate it if someone could pls direct me to the actual file where the algo for -B file test switch lies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Variable scoping, static variable

2003-03-28 Thread Shishir K. Singh
Try using it like this - use strict; my $cache = {}; test(hello0,$cache); test(hello1,$cache); test(hello0,$cache); test(hello3,$cache); sub test { my $param = shift; my $cache = shift; my $cache_key = param=$param; if (exists

RE: PipeDelimited Input / Three File Output (Positional Characters)

2003-03-11 Thread Shishir K. Singh
And pack too perldoc -f pack perldoc -f split That should solve your purpose -Original Message- From: David Olbersen [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 5:18 PM To: Gorden-Ozgul, Patricia E; [EMAIL PROTECTED] Subject: RE: PipeDelimited Input / Three File Output

RE: adding hash reference into hash

2003-03-03 Thread Shishir K. Singh
You may want to handle them as $intHash1Ref = {'A' = 'B'}; $intHash2Ref = {'C' = 'D'}; %containerHash = ('hash1' = $intHash1Ref, 'hash2' = $intHash2Ref); foreach my $hashRefKeys (keys %containerHash) { foreach my $hashKeys (keys %{$containerHash{$hashRefKeys}} ) { print $hashKeys,

RE: adding hash reference into hash

2003-03-03 Thread Shishir K. Singh
$hashKeys,, $hashRef-{$hashKeys},\n; } } -Original Message- From: Shishir K. Singh Sent: Monday, March 03, 2003 12:42 PM To: 'Hanson, Rob'; 'Yannick Warnier'; [EMAIL PROTECTED] Subject: RE: adding hash reference into hash You may want to handle them as $intHash1Ref

Display DubDirectory/Files

2003-02-28 Thread Shishir K. Singh
Hello, Is there any existing module that can list all the subdirectories/files within a given directory? TIA Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Display DubDirectory/Files

2003-02-28 Thread Shishir K. Singh
:26 PM To: Shishir K. Singh; [EMAIL PROTECTED] Subject: RE: Display DubDirectory/Files Shishir K. Singh wrote: Hello, Is there any existing module that can list all the subdirectories/files within a given directory? TIA Shishir You can use File::Find to pull out what you want

RE: Display DubDirectory/Files

2003-02-28 Thread Shishir K. Singh
Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 2:27 PM To: Shishir K. Singh; [EMAIL PROTECTED] Subject: RE: Display DubDirectory/Files Hello, Is there any existing module that can list all the subdirectories/files within a given directory

Divide Perl script

2003-02-27 Thread Shishir K. Singh
Hello, How can I divide my perl program in different files(in other words..move the sub routines in different files ) and then do an include in the mail perl file. The reason why I want to do this is because my main program is growing day by day and it's becoming difficult to navigate through

RE: Divide Perl script

2003-02-27 Thread Shishir K. Singh
Thanks to everyone, it works. -Original Message- From: Chris Rogers [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 4:58 PM To: Shishir K. Singh; [EMAIL PROTECTED] Subject: RE: Divide Perl script Just create a separate file to hold your library routines. You may name

RE: File testing

2002-09-25 Thread Shishir K. Singh
-Original Message- From: Thomas 'Gakk' Summers [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 8:34 AM To: [EMAIL PROTECTED] Subject: File testing Warning: Perl Novice Alert! I'm trying to: 1. read in a list of files, 2. test for text, 3. convert the text files from

RE: hash

2002-09-25 Thread Shishir K. Singh
There is a modeule XML::Parser ..something like this which you can look into. You can also write your code as open(XML, x) || die(Cannot open file \n); my $i = 1; my %hash_try; while(XML) { chomp; if (/test_number/) { /(test_number)(.*?)\/(\1)/; if (defined $2) { $hash_try{$i} =

RE: Help with regular expression

2002-09-25 Thread Shishir K. Singh
Nope..this won't work. Why don't you loop over the list and do a substring or pack as you know that you need to keep only the first 4 characters of each element? -Original Message- From: Shaun Bramley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 4:24 PM To: [EMAIL

Move

2002-09-17 Thread Shishir K. Singh
Is there a keyword for moving a set of files from one dir to another eg like doing move (*.log , /tmp/) without the use of glob or individual file looping. Thanks Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Remove elements in an array from a different array

2002-08-21 Thread Shishir K. Singh
use hashes. my %HASH; $HASH{$_}++ foreach @arr1; delete $HASH{$_} foreach @arr2; @arr1 = keys %HASH; @arr1 now has ( one three five ); Perhaps If you want to maintain the order in the array, you might use it this way: my %HASH; my %hORD; my $count = 0; $HASH{$_} = ($count++) for @arr1;

RE: Active State

2002-08-15 Thread Shishir K. Singh
pkgadd is one of the tools used in the Solaris implementation of the SYS V packages model. cf man pkgadd For my money - it would be simpler to use the pkgadd command on a Solaris Box. f also the regular suite of tools pkginfo pkgrm . if the folks at

RE: Active State

2002-08-15 Thread Shishir K. Singh
p0: which rev of Solaris are you working with? eg: both the OS rev 5.X and the Arch - sparc XOR i386 Machine hardware: sun4u OS version: 5.8 Processor type: sparc Hardware: SUNW,Ultra-5_10 p1: are you using gunzip to deal with unpacking them? gzip -d/gunzip

RE: Active State

2002-08-15 Thread Shishir K. Singh
Looks like you got an incomplete download. Try re-dl-ing it. I think it wouldn't have gunzipped in the first place if the file was incomplete. gzip -t ActivePerl-5.6.1.633-sun4-solaris.tar.gz returns success. But just to be on the safe side, I repeated the download/unzip process 3

RE: condition problem

2002-08-01 Thread Shishir K. Singh
Well...you are checking for REVERSE whereas you should check either for REVERS or REVERSAL -Original Message- From: Gary Stainburn [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 11:08 AM To: [EMAIL PROTECTED] Subject: condition problem Hi all, I've got the following code

RE: Extract text from argument

2002-08-01 Thread Shishir K. Singh
I took a look on www.perldoc.com and checked out split. I can't figure out how to do it from the examples? Help? Try out the following piece of code : use File::Spec; use strict; my $test = C:\\temp\\test\\filename; my ($volume,$directories,$file) =

RE: Add directories to @INC

2002-08-01 Thread Shishir K. Singh
I've been pounding perldoc for a while this morning trying to find a clear technique described to add directories to @INC (permanently). I'm sure its described somewhere but I'm not finding it. I know about the -I switch method but wanted to add certain directories permanently so perl -V will

RE: changing multiple flags and changing them back

2002-08-01 Thread Shishir K. Singh
I have a series of flags that I need to change all at once, and then change back, and was wondering if I could use an array or hash to do this. I am parsing an RTF file, and when I find a footnote, I need to preserve the flags of the non-footnote text. So if I was in a table, I need to save the

RE: Add directories to @INC

2002-08-01 Thread Shishir K. Singh
I've been pounding perldoc for a while this morning trying to find a clear technique described to add directories to @INC (permanently). I'm sure its described somewhere but I'm not finding it. I know about the -I switch method but wanted to add certain directories permanently so perl -V will

RE: Add directories to @INC

2002-08-01 Thread Shishir K. Singh
I've been pounding perldoc for a while this morning trying to find a clear technique described to add directories to @INC (permanently). I'm sure its described somewhere but I'm not finding it. I know about the -I switch method but wanted to add certain directories permanently so perl -V will

RE: Regexp to match by hash key and replace with hash value?

2002-08-01 Thread Shishir K. Singh
and replace with hash value? ok now how to build this on the fly using %hash ([12]) On Thu, 1 Aug 2002 16:01:24 -0400, [EMAIL PROTECTED] (Shishir K. Singh) wrote: You forgot to put the brackets () around [12] $line =~ s/([12])/$hash{$1}/g; -Original Message- From: chris [mailto:[EMAIL

pushd and popd

2002-07-23 Thread Shishir K. Singh
I was just wondering if there is anything similar in perl for unix commands pushd / popd ?? Thanks Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: pushd and popd

2002-07-23 Thread Shishir K. Singh
hmmm..they are array functions...I guess I can use the cwd/push/pop to simulate the pushd and popd, just was being lazy :) and wanted to know if a direct pushd popd kind of function exists!! how about functions like push, pop, shift, unshift ? -Original Message- From: Shishir K

RE: pushd and popd

2002-07-23 Thread Shishir K. Singh
I was just wondering if there is anything similar in perl for unix commands pushd / popd ?? I can't find such a thing. You (or someone else) could write one. It doesn't seem too difficult; it's just an array. Good Idea!! might as well do that!! -- To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: pushd and popd

2002-07-23 Thread Shishir K. Singh
I was just wondering if there is anything similar in perl for unix commands pushd / popd ?? pushd and popd are built-in shell commands, they aren't really Unix commands. What exactly are you trying to do? perldoc -f push perldoc -f pop perldoc -f shift perldoc -f unshift perldoc -f

RE: pushd and popd

2002-07-23 Thread Shishir K. Singh
Thanks John...I appreciate it!! I was just wondering if there is anything similar in perl for unix commands pushd / popd ?? pushd and popd are built-in shell commands, they aren't really Unix commands. What exactly are you trying to do? perldoc -f push perldoc -f pop perldoc -f

Which one is better ??

2002-07-17 Thread Shishir K. Singh
Which one is the more preferred : perl2exe or perlapp (Active state Perl Development Kit). I have not done much with perlapp and I did run into small problem using perl2exe. Just wanted to know their merits. Thanks Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: Working with hashes...

2002-07-16 Thread Shishir K. Singh
I know this has been covered before, so a faq pointer is ok w/me. I have this code: while($db-FetchRow()){ %Data = $db-DataHash(First_Name,Last_Name); foreach $key (sort(keys %Data)) { print $key, '=', $Data{$key}, \n; } # end foreach print(\n); } Just curious. I

RE: find biggest number

2002-07-16 Thread Shishir K. Singh
Why not use sort on the array and get the last element which would be the highest?? my @sorted = sort @list; my $max = $sort[$#sorted]; Wouldn't this work ? I a not sure about the speed though!! Here is a routing that i use: -- @nums = (5,6,3,7,2,9,12,46); $rv = min(\@nums); print $rv\n;

RE: find biggest number

2002-07-16 Thread Shishir K. Singh
Seems this has already been proposed by Nikola!! I like this approach as it's in the spirit of Perl and a one liner :)!! Why not use sort on the array and get the last element which would be the highest?? my @sorted = sort @list; my @sorted = sort my $max = $sorted[$#sorted]; Wouldn't

RE: Consolidate if/else

2002-07-16 Thread Shishir K. Singh
Hello all, I'm trying to get this line to work (!$opt_Z) ? die Must supply Market\n : $mkt = $opt_Z; and I keep getting compiler errors. $mkt = (defined ($opt_Z)) ? $opt_Z : die(Must supply Market\n); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: Consolidate if/else

2002-07-16 Thread Shishir K. Singh
Better use defined on $opt_Z , cause it will die even if $opt_Z has 0 , '0' or space !! Hello all, I'm trying to get this line to work (!$opt_Z) ? die Must supply Market\n : $mkt = $opt_Z; You need parens because assignment is lower precedence than ternary: (!$opt_Z) ? die Must

RE: Optimize some regex's

2002-07-11 Thread Shishir K. Singh
Try using the fetchrow_arrayref. I think it's faster as it does not have to copy the variables. Since your length is 2000, it may help a lot. -Original Message- From: Jackson, Harry [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 12:10 PM To: '[EMAIL PROTECTED]' Subject:

RE: Use vs Require

2002-07-11 Thread Shishir K. Singh
I'm new to perl, but have a background in C. Can someone tell me what is the difference between 'use' and 'require'? When do you use one and not the other? Seems they both are comparable to a C header file (.h). Thanks in advance. use is resolved during compile time whereas require is

RE: chdir to parent directory

2002-07-05 Thread Shishir K. Singh
Hello - I am trying to use ActiveState perl on windows and I am trying to figure out how to chdir to a parent directory. I have tried the following: chdir (..); chdir (\\..); chdir ('..'); chdir ('../'); Use single quotes. so that special characters are treated as literals. . and \ are

RE: How to pass the value of $@ to a subroutine

2002-07-03 Thread Shishir K. Singh
Thanks! Changing: my $message = @_; to: my ($message) = @_; did put the correct value in the string. If anyone cares to explain the difference between the code I had and the code Shishir suggested so I can understand why this makes a difference, I'm all ears! @_ is an array. You were

RE: I need help writing a hash of an array

2002-07-02 Thread Shishir K. Singh
I need to write a script that is reading line by line through a file and put it into a hash of an array that looks like this: This is just an example, so it looks like garbage. This is what I need to capture in memory and also if I was to print it, it needs to look like this in a list. My

RE: executing c program from perl script and grabbing output

2002-07-02 Thread Shishir K. Singh
I have a c program which takes two commandline arguments (both strings) and prints out a line. If I use system then I am not able to grab the output of the program and if I use backquotes `` then the arguments are also treated as commands and I get an error. Is there any other way to do

RE: executing c program from perl script and grabbing output

2002-07-02 Thread Shishir K. Singh
On Tuesday, July 2, 2002, at 11:23 , drieux wrote: I have a c program which takes two commandline arguments (both strings) and prints out a line. If I use system then I am not able to grab the output of the program and if I use backquotes `` then the arguments are also treated as

RE: Beginner with a somewhat advanced question.....

2002-07-02 Thread Shishir K. Singh
Shouldn't your query add the $Cust_ID too ?? $sql = select * from product,order_line where prod_num = product_id and order_num = $order_id; How is this query going to identify a particular customer ?? -- I'm not sure if

RE: Obtaining a slice of unique values from an array

2002-07-01 Thread Shishir K. Singh
on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote: What is the most efficient (or at least AN efficient :-) way of obtaining a slice from an array wherein the slice contains only unique values found in the array? See perldoc -q duplicate -- felix This is the example d cited in

RE: Perl Win32 Application.

2002-06-27 Thread Shishir K. Singh
I would use the Tk module. But I think there is also a Win32::GUI module. (or something like that) I would always go for Perl TK. But beware!! If you want to use some of the derived widgets...they suck !! eg ..BrowseEntry and DirTree. I had to modify them to bring back some sanity. Bur the

RE: Perl Win32 Application.

2002-06-27 Thread Shishir K. Singh
Mastering Perl Tk I guess is the better one!! -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 11:12 AM To: 'stephane groux'; Joe Echavarria Cc: [EMAIL PROTECTED] Subject: RE: Perl Win32 Application. Why do I get the feeling that I was

RE: Perl Win32 Application.

2002-06-27 Thread Shishir K. Singh
I would always go for Perl TK. But beware!! If you want to use some of the derived widgets...they suck !! eg ..BrowseEntry and DirTree. I had to modify them to bring back some sanity. Bur the best part is it works on UNIX as well as on Windows. Did your patches make it into the main

RE: extracting a string from between parens

2002-06-26 Thread Shishir K. Singh
-Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 26, 2002 11:30 AM To: todd shifflett; [EMAIL PROTECTED] Subject: RE: extracting a string from between parens I have this situation: $in = 02 Jul 5.00 (YHZ GA-E) I want

RE: extracting a string from between parens

2002-06-26 Thread Shishir K. Singh
I have this situation: $in = 02 Jul 5.00 (YHZ GA-E) I want: $out = YHZGA-E How do I extract the information between the ()s ? Other than the parens all other characters are likely to change. Perhaps $in =~ /\((.*?)\)/; $out = $1; This is a problem if there is no

RE: extracting a string from between parens

2002-06-26 Thread Shishir K. Singh
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote: $out = $1 if ($in =~ /\((.*?)\)/); Nope..won't work..I take it back!! looks ok to me. except it adds extra strokes to previous answer. what do you think is wrong with it? It will work fine as far as the regex is concerned

RE: extracting a string from between parens

2002-06-26 Thread Shishir K. Singh
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote: $out = $1 if ($in =~ /\((.*?)\)/); Nope..won't work..I take it back!! looks ok to me. except it adds extra strokes to previous answer. what do you think is wrong with it? It will work fine as far as the regex

RE: perl email

2002-06-26 Thread Shishir K. Singh
I have a perl scipt that emails certain information to me. I would like a certain line to be in bold or a different color when it is emailed. Is there a way to do this? Ernest P. Tucker II Network Technician Madison Management Area Charter Communications I can get up at nine and be rested,

RE: perl email

2002-06-26 Thread Shishir K. Singh
Include this line in the header: Content-Type: text/html And then just write out the rest as simple HTML. It's been a while since I've done it, but if you send it like this, I think it should work. From:[EMAIL PROTECTED] To:[EMAIL PROTECTED] Subject:HTML Mail content-type: text/html

RE: perl email

2002-06-26 Thread Shishir K. Singh
What about the Color ?? why not learn how to write html ? http://www.google.com/search?hl=enie=UTF-8oe=UTF8q=html+tutorialsbtnG=Google+Search Honestly...I have always dreaded HTML with all those tags!! Makes my head spin:). But then there's no way out of it:(. -- To unsubscribe,

RE: Opening a shell with perl.

2002-06-26 Thread Shishir K. Singh
Hello all. I have an interesting problem that I may be able to solve with perl. I would like to know if anyone thinks this is possible. I want to have a perl program that runs on computer A. Every hour or so, it will attempt to connect to computer B. If computer B is alive and has a seperate perl

RE: HElP ...me!

2002-06-25 Thread Shishir K. Singh
Hi everybody, Hopefully some of you will help to solve my problem!! I'm trying to parse a flat file formatted file. It's a PDB (Protein Data Bank). But I didn't find any script on internet and perl.com. If you'll help me, I will be happy and solve the problem.. Thank you. Bryce Can You

RE: Pattern Matching

2002-06-25 Thread Shishir K. Singh
I'm trying to find a way to match anything between two brackets [] The stuff in between will have alpha, numeric, and symbols (including / - @ and spaces) For instance [akens@egh-org blah/blah/blah] I need to match that entire string, including the []'s Here's the ugly thing I've

RE: getting date from localtime

2002-06-25 Thread Shishir K. Singh
Howdy: I'm trying to do the following (which may have been created already) in perl: * create two variables var1 = this will be sunday of current week always var2 = this will be saturday of current week always I'm not sure how I can use 'localtime' as a tool for identifying var1 and var2. I

RE: getting date from localtime

2002-06-25 Thread Shishir K. Singh
Howdy: I'm trying to do the following (which may have been created already) in perl: * create two variables var1 = this will be sunday of current week always var2 = this will be saturday of current week always I'm not sure how I can use 'localtime' as a tool for identifying var1 and var2.

RE: use 5.6.1

2002-06-24 Thread Shishir K. Singh
Hi expert, I am install a Bioinformatics application, which is useperl module. In Makefile.PL, there is 'use 5.6.1;', but I have only perl5 (5.0 patchlevel 5 subversion 3), and I have no 5.6.1 module. I search CPAN, I can not find this module, do I need install perl5.6.1, do I have other

RE: Reading File

2002-06-24 Thread Shishir K. Singh
Hi everybody, I've done a dummy test, and finalized that David's method is the Goal Method, that's really Really Very Great !!! I've made a 50MB Text file ( Fixed length, 1001 char per line, with \n) for this test, and have the following results : SCRIPT 1 # Suggested by Johnson

RE: matching extracharacters

2002-06-24 Thread Shishir K. Singh
Hi all, I would like to match a string variable in a longer string retreiveing the match plus 5 extra characters at each side of the match. This what I mean: $var = 'something'; $line = 'SDFGHAsomethingWDFTsft'; and, I would like to get in a new variable the string 'DFGHAsomethingWDFTs'. Any

RE: matching extracharacters

2002-06-24 Thread Shishir K. Singh
(@pop) { $code .= \tif (\$line =~ /\\b$state\\b/) {print \$line;next;}\n; } $code .= '}'; eval $code; die if @!; # -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 5:07 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED

RE: Formatting

2002-06-21 Thread Shishir K. Singh
Hi, Hello, I need to format a string in a fixed width field. The string may be less than the length of the format, or may be greater. If less, then it should get padded with spaces (left or right justified , like using - in sprintf), if greater, then the string should get truncated to

Formatting

2002-06-20 Thread Shishir K. Singh
Hi, I need to format a string in a fixed width field. The string may be less than the length of the format, or may be greater. If less, then it should get padded with spaces (left or right justified , like using - in sprintf), if greater, then the string should get truncated to the exact

C from Perl

2002-06-18 Thread Shishir K. Singh
Hi, I have a C program. In there is a function that I need for perl. This is the first time I am dealing with the C / Perl Interface. Is there any detailed reading material on how it's done ?? Any guidance would be highly appreciated. Thanks Shishir -- To unsubscribe, e-mail: [EMAIL

RE: C from Perl

2002-06-18 Thread Shishir K. Singh
. -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 10:06 AM To: Shishir K. Singh; [EMAIL PROTECTED] Subject: RE: C from Perl What's the C function? Is it something standard in C? Or did you/someone write it? and the big question: What does it do

RE: Code Generating/Compiling

2002-06-18 Thread Shishir K. Singh
Wouldn't you be needing something like perl2exe or perl2app?? Oops, one problem...they come for a price!! -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 10:22 AM To: 'Nigel Peck'; [EMAIL PROTECTED] Subject: RE: Code Generating/Compiling

RE: combining data structures into one array

2002-06-18 Thread Shishir K. Singh
push (@myVar, @$_) for @$stats; push (@myVar, @$_) for @$totals; push (@myVar, $_) for @$loads; -Original Message- From: Kipp, James [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 10:32 AM To: [EMAIL PROTECTED] Subject: combining data structures into one array I have a

RE: combining data structures into one array

2002-06-18 Thread Shishir K. Singh
: Shishir K. Singh Sent: Tuesday, June 18, 2002 10:55 AM To: Kipp, James; [EMAIL PROTECTED] Subject: RE: combining data structures into one array push (@myVar, @$_) for @$stats; push (@myVar, @$_) for @$totals; push (@myVar, $_) for @$loads; -Original Message- From: Kipp, James

RE: combining data structures into one array

2002-06-18 Thread Shishir K. Singh
Do you mean to say push (@$stats, @$totals, $loads); didn't work ?? -Original Message- From: Kipp, James [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 11:23 AM To: Shishir K. Singh; Kipp, James; [EMAIL PROTECTED] Subject: RE: combining data structures into one array I am

No of lines in a file

2002-06-18 Thread Shishir K. Singh
Hi, Is there a way to get the number of lines in a file. Conditions: a) Without using backticks on wc -l b) Without opening the file and looping over the records Thanks Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: colon(:) in split --- what does it mean ?

2002-06-18 Thread Shishir K. Singh
Probably the record is like $split_cellname = ABCDEFGHIJK:12345678 ($cellname = $split_cellname) =~ s/:.*//; $cellname will now have ABCDEFGHIJK $split_cellname =~ s/:.*// = substitute any character starting with : till the end of the string (s/:.*/), in $split_cellname, to NULL (//)

RE: No of lines in a file

2002-06-18 Thread Shishir K. Singh
Uh oh!! Thanks !! Guess I will have to do it the old fashioned way!! -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 11:51 AM To: Shishir K. Singh; [EMAIL PROTECTED] Subject: RE: No of lines in a file -Original Message- From

RE: combining data structures into one array

2002-06-18 Thread Shishir K. Singh
], etc ]; so i want to end up with something like: @stats = ( [oracle, 6.8, 11.2,15.8, 17.2 ], [ksh, 1.8, 1.2, 3.7, 3.9 ], etc... ); thanks. -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 11:04

RE: literal to regex

2002-06-13 Thread Shishir K. Singh
Think you need to use \Q$string\E -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 11:05 AM To: Beginners (E-mail) Subject: literal to regex I want to convert a bunch of strings to regexs but I want all special characters to be

RE: THIS IS A TEST - PLEASE DELETE THIS EMAIL - THANKS

2002-06-12 Thread Shishir K. Singh
Or..what the hell am I doing here ?? :) -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 5:19 PM To: '[EMAIL PROTECTED]' Subject: RE: THIS IS A TEST - PLEASE DELETE THIS EMAIL - THANKS I think these kinds of messages would be cooler

RE: chop off 1 white space?

2002-06-11 Thread Shishir K. Singh
Is it only one Trailing white space or any trailing white space?? If any trailing white space , then you can do $HASH{$key} =~ s/\s+$//; If One ... $HASH{$key} =~ s/\s+$//; And then you can compare if ($HASH{$key} eq $myVariable) { } -Original Message- From: Alaric Joseph

RE: chop off 1 white space?

2002-06-11 Thread Shishir K. Singh
oopsfor one you do $HASH{$key} =~ s/\s$//; -Original Message- From: Shishir K. Singh Sent: Tuesday, June 11, 2002 4:31 PM To: Alaric Joseph Hammell; [EMAIL PROTECTED] Subject: RE: chop off 1 white space? Is it only one Trailing white space or any trailing white space

RE: chop off 1 white space?

2002-06-11 Thread Shishir K. Singh
^ - Beginning o the string $ - End of the string $myVar =~ s/^\s+//; - Remove all Leading White Space $myVar =~ s/\s+$//; - Remove all Trailing White Space What is your actual requirement ?? -Original Message- From: Alaric Joseph Hammell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June

IP address

2002-06-07 Thread Shishir K. Singh
Hello, I have a requirement to get the IP address of a user logged from a remote machine on to UNIX machine. Now the user can be using multiple logins through VPN or otherwise. I need to create something akin to command finger which will return the user his IP address based on his current

RE: IP address

2002-06-07 Thread Shishir K. Singh
for something which is shell/platform independent. Can it be done ?? -Original Message- From: drieux [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 2:18 PM To: perl beginners Subject: Re: IP address On Friday, June 7, 2002, at 09:41 , Shishir K. Singh wrote: I have

RE: IP address

2002-06-07 Thread Shishir K. Singh
My faultI meant the remote hostname. -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 4:38 PM To: 'drieux'; begin begin Subject: RE: IP address Maybe I misunderstood what he was asking. I thought he wanted to find out what the

RE: IP address

2002-06-07 Thread Shishir K. Singh
it for the time being by putting the following in my ..cshrc (cshell) by doing setenv DISPLAY `who -m | sed 's/.*(\(.*\))$/\1/'`:0.0 -Original Message- From: David T-G [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 5:12 PM To: perl beginners Cc: Shishir K. Singh Subject: Re: IP

Question- Archive::zip/tar

2002-06-05 Thread Shishir K. Singh
Hello, I haven't tried it yet and wanted to know if anyone has the clue before I delve deeper into it (just being lazy :)). According to the documentation , the Archive::Tar module supports the *.gz format. I didn't find anything about *.Z (the compress format on UNIX). Does Archive::Tar

RE: Question- Archive::zip/tar

2002-06-05 Thread Shishir K. Singh
the code to work for the *.Z. Any gurus out there who can help ?? Thanks Shishir -Original Message- From: Beau E. Cox [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 2:16 PM To: Shishir K. Singh; BeginnersPerl (E-mail) Subject: RE: Question- Archive::zip/tar Shishir

RE: Help in Regular expression with array

2002-06-05 Thread Shishir K. Singh
Don't know if you can do a search on an array (until and unless you want to evaluate each element) In case you are trying to achieve the multiple lines search, maybe this or the 2nd example can help : open (FILE , $ARGV[0]); my @lines = FILE; close(FILE); $line = join( , @lines);

RE: Help in Regular expression with array

2002-06-05 Thread Shishir K. Singh
!! -Original Message- From: Eric Beaudoin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 4:29 PM To: Shishir K. Singh Cc: Ankit Gupta; [EMAIL PROTECTED] Subject: RE: Help in Regular expression with array At 16:12 2002.06.05, Shishir K. Singh wrote: open (FILE , $ARGV[0]); print ok

RE: Day Month Issues

2002-06-03 Thread Shishir K. Singh
try putting my before the declaration my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); -Original Message- From: Lance Prais [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 1:55 PM To: Perl Subject: Day Month Issues I am getting the following error

RE: manipulating arrays/scalars

2002-06-03 Thread Shishir K. Singh
How about writing it like this ?? Assuming a) The numeric value is in 1st col and the text in 2nd col (after :) b) Wherever numeric value is not present, the text is in the first column. c) The numeric value needs to be picked up from the last successful read of the numeric value if not

RE: help in regular expression

2002-05-31 Thread Shishir K. Singh
You forgot to add g (global)in the end... $dirstruct =~ s/([\W])/-/g; Cheers Shishir -Original Message- From: Ankit Gupta [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 10:53 AM To: [EMAIL PROTECTED] Subject: help in regular expression Hello Friends, I need help in the below

RE: Simple array question

2002-05-31 Thread Shishir K. Singh
No of elements in an array is given by $#ARRAY_NAME eg the number of element in an array @array is $#array -Original Message- From: Barry Jones [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 11:17 AM To: Beginners @ Perl (E-mail) Subject: Simple array question What type of

RE: Simple array question

2002-05-31 Thread Shishir K. Singh
oops $#array is the index index of the last element -Original Message- From: Shishir K. Singh Sent: Friday, May 31, 2002 11:23 AM To: Barry Jones; Beginners @ Perl (E-mail) Subject: RE: Simple array question No of elements in an array is given by $#ARRAY_NAME eg the number

RE: Printing all elements of an Array except the first?

2002-05-31 Thread Shishir K. Singh
I generally do it the tough way :( ### open (CUST, $cust) or die Cant open it :$!; $newnum = 0; while (CUST) { chomp; @data = split /\|/; $newnum++; $hData{$data[1]}{$newnum} = [@data]; # 2 dimensional hash used in case your 2nd element may

  1   2   >