Re: Chomp to trim '\r'

2003-10-08 Thread Carl Jolley
On Wed, 8 Oct 2003, Sisyphus wrote: > Lee Goddard wrote: > > > > > Why not use a regular expression? > > > > I can't find an answer to that question - and, judging by the responses > so far received, nor can anyone else !! > > ;-) > You know that in perl "TAMTOWTDI". However usually t

Re: array of anon. hashes sorting

2003-10-06 Thread Carl Jolley
On Fri, 26 Sep 2003, Jay Ay wrote: > hi there > > i want to be able to sort an array of hashes. > > for example, i create each hash like this and push it on to the array. > push(@senddata,{ 'sender' => $se, 'recip' => $re, 'smtphost' => $svr, > 'number' => $somenbr}); > > what i want to do is sort

Re: Array question

2003-10-06 Thread Carl Jolley
On Fri, 26 Sep 2003, Michael D. Smith wrote: > > > > This is perl, arrays start at zero, get used to it. > > Right :) > > And to perl you could add C, and it's offspring C++, and Fortran and COBOL > and JAVA(Script) and... I didn't even know there was one that didn't. I > know nothing of pascal b

RE: Perl and MS Publisher

2003-10-06 Thread Carl Jolley
On Fri, 26 Sep 2003, Erich Beyrent wrote: > Yes I did. I also checked ppm, and Googled a bit. I was looking for > tutorials on how to control Publisher, and was thinking I could probably > use Win32-OLE to do it, but I found nothing. > > Has anyone tried this? > It would kinda suprise me if MS

RE: How to skip unwanted columns in CSV file?

2003-10-06 Thread Carl Jolley
On Fri, 26 Sep 2003, Ken Cornetet wrote: > open FILE blah, blah... > while() { > chomp; > my @tmp = split /,/; > my $col3 = $tmp[2]; > my $col12 = $tmp[11]; > my $col20 = $tmp[19]; > } > > I suppose you could get fancy and use DBI and DBD-CSV. > Or you could use a

Re: How to skip unwanted columns in CSV file?

2003-10-06 Thread Carl Jolley
On Fri, 26 Sep 2003, Noushad Dawood wrote: > I'm trying to read a huge CSV file which got 30 columns separated by comma, > but i only need to get values of 3rd, 12th and 20th columns. Is there a > neat and easy way to get this done? > One way would be to use an array slice: while($row=) { chomp

Re: Array question

2003-09-26 Thread Carl Jolley
On Fri, 26 Sep 2003 [EMAIL PROTECTED] wrote: > > Hai, > > can any one tell how to pick up a particular pattern of files into that > array... > > Eg:- files with extension .pl or .cfg > @selected=grep{ /\.(?:pl|cfg)$/ } <*.*>; [EMAIL PROTECTED] All opinions are my own and not necessari

RE: Regular Expression problem?

2003-09-26 Thread Carl Jolley
On Fri, 26 Sep 2003, Xu, Qiang (XSSC SGP) wrote: > Ted S. wrote: > > Beckett Richard-qswi266 graced perl with these words of wisdom: > >> That should have been s/.*\/// > > > > Don't you have to escape the period, too? > > > > s/\.*\/// > > No, we shouldn't, because here "." stands for any single

Re: Array question

2003-09-26 Thread Carl Jolley
On Thu, 25 Sep 2003, Ken McNamara wrote: > Use opendir, readdir - if $array[0] is really a problem then do > push(@array2,'',@array) - which will leave a null entry in the > $array2{0] slot. > > > "Wong, Danny H." wrote: > > > > Hi all, > > I was wondering if I can start adding elements in

Re: Array question

2003-09-26 Thread Carl Jolley
On Thu, 25 Sep 2003, Wong, Danny H. wrote: > Hi all, > I was wondering if I can start adding elements into an array > starting at 1? Here is what I am trying to do. I'm trying to glob all > files/folders in a directory and assign it to an array, but it start at > subscript 0. I know I can do

Re: Date manipulation in Perl

2003-09-25 Thread Carl Jolley
On Wed, 24 Sep 2003, ashish srivastava wrote: > Hi > > I have 2 queries each of which return date in the following format : > dd=mon-yy:hh:mi > The results are (say) final_time and start_time. > I want to get the time difference between the 2 times(in days or hours). > Any pointers in this regard

Re: OT: Regex humor

2003-09-18 Thread Carl Jolley
On Thu, 18 Sep 2003, Ted Schuerzinger wrote: > This, I suppose, is proof that computers are only as bright as the people > who program them, and a good lesson on being careful what you look for in > your regexes :-) > > I've noticed that spammers sometimes try to get around people's spam > fi

Re: Reg Expression missing last char?

2003-09-18 Thread Carl Jolley
On Wed, 17 Sep 2003, Capacio, Paula J wrote: > I am using $1 and $2 to retain data from a matched regular expression. > I expect $1 to contain the KEY ID and $2 to contain USER NAME, but $2 is > missing the last character. See the code and results below. > (watch out for text line wrapping) > Tha

Re: win32::ODBC insert error

2003-09-18 Thread Carl Jolley
On Tue, 16 Sep 2003, Mark Elliott wrote: > I get this error: > > "[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored > procedure 'insert into hosts (HOST,lastchk) > > When I attempt to insert a bunch of rows into a MSSQL table. It gets data > from a text file. > > Here is the co

Re: newbie hlelp!

2003-09-18 Thread Carl Jolley
On Tue, 16 Sep 2003, alex p wrote: > Might it be the way i have it set on my computer to read the time? > I have copied and pasted $Bill's code onto mine and I still get the same > output! > > foreach $f (@allfiles) > { > unless ( ($f eq ".") || ($f eq "..") ) > { >

Re: newbie hlelp!

2003-09-16 Thread Carl Jolley
On Tue, 16 Sep 2003, alex p wrote: > Thank you all for replying, I am using the code below and I am still unable > to get the correct date > > opendir (DIR, "$server\\c\$\\sys\\data\\LOG\\updates"); > @allfiles = readdir(DIR); > #print("," readdir(DIR)); > #closedir(DIR); > foreach $f

Re: newbie hlelp!

2003-09-15 Thread Carl Jolley
On Mon, 15 Sep 2003, $Bill Luebkert wrote: > alex p wrote: > > > Hello all, > > > > I am trying to figure out a way to get the "last modified" date of a file. > > I have looked at the following modules but they dont seem to address what i > > need: stat, utime, opendir > > > > does anyone know ho

RE: Mail::Sendmail module problem?

2003-09-15 Thread Carl Jolley
On Mon, 15 Sep 2003, Xu, Qiang (XSSC SGP) wrote: > Hi, Lakoduk: > > Thanks for pointing out the help webpage. Now I can use Mail::Sender to send > mails. But I have difficulties with attachments. I don't know why it always > complains that the file can't be found. My script is: > > ---

Re: Use of uninitialized value in concatenation (.) or string at...

2003-09-07 Thread Carl Jolley
On Sat, 6 Sep 2003, Devon Young wrote: > What does this mean?? I'm thoroughly puzzled and I've been scouring the net > for an answer. I've been assuming it means I'm not putting strings together > correctly, but I can't figure out how to fix it. Here's the errors I'm > getting, followed by the pei

Re: How can I write in perl: #ifdef __GNUC?

2003-09-04 Thread Carl Jolley
On Thu, 4 Sep 2003, Ecker Sandor wrote: > Hi! > > I write a program for a win98 machine, and I use (thenks for this list) the > Win32::Serialport module. But I would like to test this program under Linux, so > I would like to write something like this: > > package Utils; > #ifdef __WIN32

Re: Illegal octal digit '9' problem??

2003-09-02 Thread Carl Jolley
On Tue, 2 Sep 2003, Keith C. Ivey wrote: > steve silvers <[EMAIL PROTECTED]> wrote: > > > use strict; > > my @numbers = (4,09,15); # 09 will error, 9 won't error > > my @numbers2 = (2,4,11); > > my (%hash_lookup,%hash_lookup2); > > @[EMAIL PROTECTED] = ('Y') x @numbers; > > If you had 07 it would

Re: Regex Help Needed

2003-09-02 Thread Carl Jolley
On Tue, 2 Sep 2003, Dax T. Games wrote: > I have a list of characters. I need to get a list of all possble sequences of these > characters for example. > > I have a string that consists of '-mevqgn' I need to pattern match any combination > of 'mevqgn' with a preceding - or --. > > Right now th

Re: Illegal octal digit '9' problem??

2003-09-02 Thread Carl Jolley
On Tue, 2 Sep 2003, steve silvers wrote: > With the below snippet, the numbers "8" and "9" work great, but "08" and > "09" give the error Illegal octal digit '9' or '8'. I read that these are > two numbers that will have this problem! How do I get around this problem? > Ohh, don't use leading zer

Re: unlink doesn't

2003-08-29 Thread Carl Jolley
On Fri, 29 Aug 2003, Robert Shields wrote: > my $logdir = $Server->Mappath ("logs"); > > if (!opendir (LOGDIR, "$logdir")) { > > $Response->write ("Could not open directory $logdir: $!"); > > } else { > > my @files = grep (/.*\.xml/, readdir(LOGDIR)); > > @files = sort @files; >

RE: WMI wierdness.

2003-08-29 Thread Carl Jolley
= substr($os->{'LastBootUpTime'},8,2); > my $bmin = substr($os->{'LastBootUpTime'},10,2); > my $bsec = substr($os->{'LastBootUpTime'},12,2); > my $cyear= substr($os->{'LocalDateTime'},0,4); > my

Re: stopping a running process

2003-08-29 Thread Carl Jolley
On Thu, 28 Aug 2003, just me wrote: > hi > > i have a program that executes and generates a log > file and it will stay there collecting logs till user > intervention like Ctrl C. If i wanted to write a perl > script and schedule it to stop the program after a > certain time , how do i do it?? any

Re: Perl newb

2003-08-28 Thread Carl Jolley
On Thu, 28 Aug 2003, C. Church wrote: > > if ($comment =~ /\a?<(.*?)>/) { > > > > } > > It says that if the contents of $comment match the regular expression on the > right, execute the block following. > > As for the RE: > > /\a?<(.*?)>/ > > the \a? means 1 or 0 alarms -- this is only superfluous

Re: How to execute a command under win98 via perl script?

2003-08-27 Thread Carl Jolley
On Wed, 27 Aug 2003, Tony Cheung wrote: > Hi, everybody > How to execute a command under win98 via perl script? Example: copy c:\a.txt d:\ > Thanks Look at the docs in perlfunc for the system() function and either use single quotes or escape the backslashes if the parameter string uses double qu

Re: Obtaining a perl hash id in a call back function.

2003-08-27 Thread Carl Jolley
On Wed, 27 Aug 2003, Saber ZRELLI wrote: > > Hi all , > > > The problem is as follows : > > > i have several communication sockets , to each socket i attach a costumised > output window ( which is a perl object i've created ) . > and i store all the output windows in a hash called WIN_LIST , this

RE: How to execute a command under win98 via perl script?

2003-08-27 Thread Carl Jolley
On Wed, 27 Aug 2003, Wenjie Wang wrote: > system "copy c:\a.txt d:\a.txt"; > This won't work due to unescaped backslashes in a double quoted string. [EMAIL PROTECTED] All opinions are my own and not necessarily those of my employer ___

Re: Invoke perl script from CGI and redirect STDOUT, STDERR to afile

2003-08-27 Thread Carl Jolley
On Wed, 27 Aug 2003, Savinder Puri wrote: > Hi All, > > Here's what I want to do: > > 1. A web-page invokes a CGI perl script (say cgi.pl), and passes certain user inputs > in the QUERYSTRING. > > 2. The CGI script does some pre-processing and invokes another perl script (say > a.pl), passing it

Re: Command line options question

2003-08-27 Thread Carl Jolley
On Tue, 26 Aug 2003, Medlen, Jiri wrote: > Hi, > > I'm trying to simply capture VBAV29933 using Command line option > > result_sale.tmp contains > jmedlenproverisign< > /Partner>0 >MatchNo > MatchService Not > RequestedApprovedVBAV29933 Code>894PNI000 ata Name="IAVS" > Value="N"> > > > > perl -

RE: Win32: does anyone know how to fork a process ?

2003-08-25 Thread Carl Jolley
On Mon, 25 Aug 2003, Primanti, Joseph T wrote: > Try this: > > use Win32::Process; > > > my $ProcExe = "c:\winnt\notepad.exe"; > my $ProcCmd = "notepad.exe"; > &createproc($Exe[0], $Exe); > > > sub createproc() { > my ($ProcExe) = $_[0]; > my ($ProcCmd) = $_[1]; > Win32::Process::Create($Proce

RE: about "use"...

2003-08-24 Thread Carl Jolley
On Sun, 24 Aug 2003, [iso-8859-9] [e]agLØrT wrote: > hi.. > > just got, i can change the options with CHMOD. so, the script will be not > executed and not read, can't i? > Sure, but what use is a write-only script? Perl has to read it to interpret it. [EMAIL PROTECTED] All opinions ar

Re: reg exp seems to fail on stripping http headers under perl 806

2003-08-21 Thread Carl Jolley
On Wed, 20 Aug 2003, john z wrote: > hi: > when i bring in a gif or jp file from http with a get, the headers come > along with the file. ive been trying to strip them and noticed that the reg > exp seems to fail under perl 806. > > the following should (imho) work but dont. > $got_gif=~s[^http(.*

Re: NEED DEVICE : ftp disconnect

2003-08-21 Thread Carl Jolley
On Wed, 20 Aug 2003, agharmine youssef wrote: > > > -Message d'origine- > De : agharmine youssef > Envoyé : mercredi 20 août 2003 09:45 > À : '[EMAIL PROTECTED]' > Objet : TR: ftp disconnect ? > > > > > -Message d'origine- > De : agharmine youssef > Envoyé : mercredi 20 août 2003

Re: Need advice on obtaining MAC addresses...

2003-08-21 Thread Carl Jolley
On Wed, 20 Aug 2003, Todd Morrison wrote: > Hello, > > Is there a way to capture a user's MAC address when a user visits a web > page? Can this info be captured through the use of $ENV{'HTTP_USER_AGENT'} > or perhaps a Net module? > > Any help/suggestions would be greatly appreciated. I am still a

Re: Help with snippet

2003-08-21 Thread Carl Jolley
On Wed, 20 Aug 2003, steve silvers wrote: > This should be easier than this. The script below works, except where it > matches with a number it has a duplicate? > > #!Perl > > $count = 0; > $nums = 0; > $numbers = > "04|09|15|16|21|23|25|29|38|40|41|42|54|55|56|62|64|65|67|68|73|80"; > > @a

Re: Slow file reading...

2003-08-20 Thread Carl Jolley
On Wed, 20 Aug 2003, Ulf Lowig wrote: > Hi, thanks fore the answers from all of you. > > One question that frequent comes back to me is why I am reading it to a > memory. The answer is, I am not going to read it into memory, I plan to > open a file handle and insert the hole file into as MS SQL se

RE: Slow file reading...

2003-08-20 Thread Carl Jolley
On Wed, 20 Aug 2003 [EMAIL PROTECTED] wrote: > > freed and available segment of memory that was used. My WAG is that if > > you changed the order of the different ways of reading the whole file, > > the first read will take longer than the others. > > Exactly. > Anyway the time is the order of a f

Re: CPAN Module UNIX Windows newline character

2003-08-18 Thread Carl Jolley
On Mon, 18 Aug 2003, $Bill Luebkert wrote: > Peter Eisengrein wrote: > > > Here's a simple unix2dos script to save you from having to do the MS > > Word conversion in the future. > > > > This script will only work on a Windoze system of course: > > > ### unix2dos.pl > > > > use strict; > > use Fil

Re: Thoritical limits on perl processes

2003-08-18 Thread Carl Jolley
On Mon, 18 Aug 2003, Subrahmanyam Vadlamani wrote: > Hi: > > Suppose I want to read in large text files and want to > do something with them. Are there any theoritical > limits on the process size of a perl script? > > My scripts are going to be running on an AIX 5.1 > machine with quite a bit of

Re: What is wrong with this?

2003-08-14 Thread Carl Jolley
On Tue, 12 Aug 2003, steve silvers wrote: > I don't understand why the output of the below snippet kind of blows up.. > > --TEXT FILE test.txt-- > > 03|04|09|14|15|18|24|27 > 09|23|24|26|27|28|33|35 > 10|11|13|15|17|18|19|22 > 07|08|13|17|22|23|24|25 > 03|06|07|08|11|12|16|17 > 02|05|06|09|12|18|1

Re: CGI Error

2003-07-26 Thread Carl Jolley
On Sat, 26 Jul 2003, [gb2312] л ¸ù±¾ wrote: > i got a CGI Error message > The specified CGI application misbehaved by not returning a complete set of > HTTP headers. The headers it did return are: > > there are the relative codes in the script > print header, > start_html('mail'), > i don

Re: Rename does not work with Windows

2003-07-25 Thread Carl Jolley
On Fri, 25 Jul 2003, Perl Thingy wrote: > Hi, > > I use the statement in OS Win2K: > rename(oldfile, newfile); > even though it could see the file, but it doesnot seem to do rename. > It may have somthing to do with permission, but I'm the one who wrote the > script! > Any idea as why it's not wor

Re: Archive::Zip

2003-07-25 Thread Carl Jolley
On Thu, 24 Jul 2003, Alexander Bel... wrote: > Hi guys! > I am currently trying write script for archiving of the data under Linux OS. > > In the Windows OS I don't have a problem. I put putch f:/usr/web. It working fine. > But in the Linux I put path /var/www and I receive error: > Can't locate

Re: Page generation tweeking

2003-07-23 Thread Carl Jolley
On Wed, 23 Jul 2003, Farrington, Ryan wrote: > Ok I have a page that reads 2 files into arrays. Pretty simple stuff like > this: > open(FILE, "file1.txt"); > @file1 = ; > close(FILE); > > open(FILE, "file2.txt"); > @file2 = ; > close(FILE); > > Now file1 contain

RE: regular expression on military time

2003-07-21 Thread Carl Jolley
On Fri, 18 Jul 2003, Ted S. wrote: > On 18 Jul 2003, Carl Jolley wrote in perl: > > > On Thu, 17 Jul 2003, Ted S. wrote: > > > >> On 17 Jul 2003, Tobias Hoellrich wrote in perl: > >> > >> > my @t=("08:00", "23:59", "00

Re: Problem reading directory in perl via IIS

2003-07-21 Thread Carl Jolley
On Mon, 21 Jul 2003, Stewart, Tom wrote: > I seem to have a problem reading a directory using opendir() within a perl > script launched from a IIS server. I have added the code to use NetResource > and it works fine at cmd line but not within IIS. Has anyone else run into > this problem? > When y

Re: Reading EXCEL Sheet question

2003-07-21 Thread Carl Jolley
On Mon, 21 Jul 2003, Gianvittorio Negri wrote: > I perl-ers. > > I have a question regarding the Excel I/F using perl > > I'm using a script reading excel sheet as a configuration file and the script is an > infinite loop and it is closed only by CTRL-C or KILL command. In this condition the > e

RE: Get time and date for 2 weeks at a time

2003-07-18 Thread Carl Jolley
On Wed, 16 Jul 2003, Gerber, Christopher J wrote: > -Original Message- > > From: Carl Jolley [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, July 16, 2003 2:59 PM > > To: Tobias Hoellrich > > > > On Wed, 16 Jul 2003, Tobias Hoellrich wrote: > > >

Re: Get time and date for 2 weeks at a time

2003-07-16 Thread Carl Jolley
On Tue, 15 Jul 2003, steve silvers wrote: > Quick question. I need my script to generate two weeks worth of dates and > days starting with the Saturdays. > > So on Friday 07/04/2003 my script would generate the below for the next two > weeks, and so on.. > > 07/05/2003Saturday > 07/06/2003

Re: Error trapping

2003-07-15 Thread Carl Jolley
On Mon, 14 Jul 2003, FARRINGTON, RYAN wrote: > Ok I have a perl script that has been compiled as an executable and is > running on a 2K server as a service. Now the problem is that it is die'ing > without generating an error. Is there anyway to trap the die and then have > it output it to a functi

Re: More confused Re: Resetting $1 when no-match

2003-07-15 Thread Carl Jolley
On Sun, 13 Jul 2003, Lawrence F. Durfee wrote: > I wanted to examine my old code to see that this isn't a problem elsewhere. I > thought I understood the issue, but I guess not. I looked at several PerlMonk > threads, as suggested, including: >http://www.perlmonks.org/index.pl?node_id=30

Re: Foreach question.

2003-07-11 Thread Carl Jolley
On Fri, 11 Jul 2003, Beckett Richard-qswi266 wrote: > Guys, > > This is one I don't know how to approach at all. > > I've read a text file into @lines. > I then process it like this... > > foreach (@lines) { > last if /Next section$/; > next unless (/match$/); > chomp; > pr

Re: Excel and empty rows.

2003-07-11 Thread Carl Jolley
On Fri, 11 Jul 2003, Beckett Richard-qswi266 wrote: > Guys, > > I have sorted out what the problems are, I just don't know how to address > them. > > I am trying to find the first empty row in a spreadsheet. > > If I use this suggestion: > > my $EmptyRow = $sheet->UsedRange->rows->count; > $EmptyR

Re: This is what confuses me about my...

2003-07-10 Thread Carl Jolley
On Thu, 10 Jul 2003, Beckett Richard-qswi266 wrote: > Hello World! > > This is why I get into a state with my. > > Because the first time I encounter $spreadsheet in my script is within > brackets, I have to add the line "my $spreadsheet" at teh beginning of my > script. > > Is there a way of effe

Re: Excel, hyperlinks and empty rows.

2003-07-10 Thread Carl Jolley
On Thu, 10 Jul 2003, Beckett Richard-qswi266 wrote: > Guys, > > Struggling to find the following information... > > I'm using Win32:OLE to insert text into a spreadsheet. > > Currently I have to start a new spreadsheet every time. How can I detect the > first empty row, so that I can append new da

Re: case insensitive index() ?

2003-07-08 Thread Carl Jolley
On Tue, 8 Jul 2003, =James Birkholz= wrote: > Is there a way to do an index function that is case-insensitive? > > For example: > > sub stripTag { > my $startTag = $_[0]; > my $endTag = $_[1]; > while (index($content, $startTag)>0) { > my $first = substr($content, 0

Re: Help needed: String 'C++' was treated as "Nested quantifiers"

2003-07-07 Thread Carl Jolley
On Mon, 7 Jul 2003, Wenjie Wang wrote: > Greetings, > > I'm using regular expressions to parse strings read in from a data file. > The data file happened to have text which contains "++" and it was treated > as "Nested quantifiers before << HERE in regex m/%s/" at run time. Is there > any way to

Re: Easy Reg-Ex

2003-07-07 Thread Carl Jolley
On Fri, 4 Jul 2003, M Ajmal wrote: > Hi, > > I'm parsing a file and want to eliminate all lines > that start with "Test" and end with "PASS!". I'm > trying to do the following: > > /^Test.+PASS!$/ > > but it says no patterns match! > > Some help please. Show more code, please. [EMAIL PROTEC

RE: Easy Reg-Ex

2003-07-07 Thread Carl Jolley
On Fri, 4 Jul 2003, Beckett Richard-qswi266 wrote: > Isn't it because the ! hasn't been escaped with a \ that it doesn't work? > > That's what I thought, hence: > > /^Test.+PASS\!$/ > > This seems to work nicely. > - The ! is not a regex metacharacter so it doe

Re: how to speed up my program?

2003-07-03 Thread Carl Jolley
On Wed, 2 Jul 2003, Shuo Wang wrote: > Hi, guys, > I am writing a perl program with losts calculations and loading lots of data. It is > quite slow. Is there anyway to speed it up? Thanks. > Yes, run your code on a faster computer OR show us some code and _maybe_ someone on this list can suugest

Re: Perl Formats

2003-06-27 Thread Carl Jolley
On Fri, 27 Jun 2003, Christopher Moss wrote: > Can anyone help me with this problem? I am trying to produce a report > using the format function that is in the following format (trivial > example): > > Family Name Role Name > > flintstones lead

Re: out of memory problem!

2003-06-25 Thread Carl Jolley
On Wed, 25 Jun 2003, Suwimon Kooptiwoot wrote: > Hi all, > My perl program cannot work with input data, text file, size 48 MB!. I > am running ActivePerl 5.6 under Windows XP, 1 GB RAM . It takes > running time overnight more than 15 hours then show me that it's out of > memory. How can I do ?

Re: Trouble counting chars

2003-06-18 Thread Carl Jolley
On Tue, 17 Jun 2003 [EMAIL PROTECTED] wrote: > Hi! > > i've been writing a sub in order to validate a list of permissions. > Each permission must appear once at most. Code and result are below. > > i run a simple test against the group of permission but i can't > figure out why it stops working wh

RE: Help needed -- Net::telnet gives errors

2003-06-14 Thread Carl Jolley
On Sat, 14 Jun 2003, ashish srivastava wrote: > Hi Ibrahim > Thanks for ur help ! > I am able to connect to the UNIX server using Prompt=>'/[\w]$-/' (the login > being the user id with which the person has logged in eg. "tom-" ). But 1 > more prob. > i have an application in which this perl script

RE: Reverse of Chomp..(regarding not chomping)

2003-06-14 Thread Carl Jolley
On Fri, 13 Jun 2003, George Gallen wrote: > Possibly in some cases, yes. In my case no. While > yes by creating a second working array which is > chomped would be fine, except for the additional > memory needed to hold the second array. That also > assumes that the array contents won't change from

RE: Win32::OLE and Excel Sorting

2003-06-12 Thread Carl Jolley
On Thu, 12 Jun 2003, Charbeneau, Chuck wrote: > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Subject: Win32::OLE and Excel Sorting > > > heres one for u folks to get ur heads around - cos its doin mine in > > > > keeps throwing range method error in OLE > > > The problem lies in the d

Re: "-d" file test under WinXP Pro?

2003-06-12 Thread Carl Jolley
On Wed, 11 Jun 2003, Paul Decker wrote: > I don't seem to be able to test for the existence/non-existence of a > directory path using the "-d" file test using AS Perl 5.6.1 on WinXP > Pro. Regardless of the existence of the directory, the test returns > true. Anyone else see this? > See what? S

Re: easy newbie REGEX

2003-06-12 Thread Carl Jolley
On Tue, 10 Jun 2003, alex p wrote: > All, > I am really bad at REGEX's and am in need of help! > I have a script that asks for users input but I need to check that the input > begin with "MDS(and a number 0-9)" before proceeding > > below is something like what I am doing: > > print "ask for input

RE: Can't locate Cisco.pm in @INC...again

2003-06-10 Thread Carl Jolley
On Tue, 10 Jun 2003, [iso-8859-1] Wermström Emma wrote: > Hi Randy, > > >Do you have similar problems with any other modules? For example, > >if you do > > C:\> perl -MNet::Telnet -e "print 1" > >is an error produced? > > >If you make up a file Silly.pm: > >==

Re: Use of "split" function...

2003-06-10 Thread Carl Jolley
On Mon, 9 Jun 2003, Zbynek Houska wrote: > dear all, > > I wonder how to initialize and use "split" function in this case: > > here are some datas (stored in file): > > 28.10.2002 06:47 Almighty - Just add life > 28.10.2002 06:47 Anastacia - Freak of nature > 28.1

Re: Global substitution

2003-05-31 Thread Carl Jolley
On Fri, 30 May 2003, Nut Cracker wrote: > open(MF, "MyFile.txt"); > while(defined($line=)){ > if($line =~ /\/ig){ > $line =~ s/\/\r/; > } > } > > > it might be ugly, but it should work. > > NuTs > It's unnecessarily ugly. There's no need to esca

Re: Global substitution

2003-05-31 Thread Carl Jolley
On Fri, 30 May 2003, Charlie Schloemer wrote: > - Original Message - > From: "Ricci, Mark" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, May 30, 2003 11:04 AM > Subject: Global substitution > > > > Hello All, > > > > I have a file that has characters instead of carriage re

Re: Global substitution

2003-05-31 Thread Carl Jolley
On Fri, 30 May 2003, Ricci, Mark wrote: > Hello All, > > I have a file that has characters instead of carriage returns. > I'm having a hard time coming up with an automated search and replace > script. > > Any ideas would be appreciated... > How about $data=~s//\n/gi; [EMAIL PR

Re: Sessions needed??

2003-05-31 Thread Carl Jolley
On Fri, 30 May 2003, a a wrote: > Alright, perhaps some more info on why I *thought* I > may need them... > > I'm trying to set up a site that will serve as an > automarker for a contest. So, people uplaod their > source code, and then the script compiles it, runs the > executable, checks output,

Re: Daemonizing a perl application

2003-05-31 Thread Carl Jolley
On Fri, 30 May 2003, Mark Calleja wrote: > G'day All, > > I'm trying to daemonize a perl app under Windows but without much joy. Under > a *nix OS I have no such problems, as the following bit of code does the > trick: > > > use POSIX; > > $pid = fork; > exit if ($pid); > die "Couldn'

Re: Single quotes on the command line

2003-05-31 Thread Carl Jolley
On Thu, 29 May 2003 [EMAIL PROTECTED] wrote: > I'm not a Windows user, so be patient with me. > > Is there something wrong with my installation or is this normal behavior? > > C:\>perl -e 'print "hello\n"' > Can't find string terminator "'" anywhere before EOF at -e line 1. > > C:\>perl -e "print

Re: What is wrong here (finding zero sized file )...

2003-04-04 Thread Carl Jolley
On Thu, 3 Apr 2003, Daniel Gross wrote: > Hello, > > I am trying to find all files that have zero size, but it doesn't work > -- why? > > > my @tmpArray = glob("$dirName/*.tif"); > my @zeroFiles = getZeroSizeTiffs(@tmpArray); > > sub getZeroSizeTiffs { > my (@tiffFiles) = @_; > > my @z

Re: Chopping out 5 Digits At the end of a string

2003-03-28 Thread Carl Jolley
On Wed, 26 Mar 2003, viktoras wrote: > Hi ! > This is the fastest :-) > > substr($i, -5, 5)=""; > > where $i is your number or any other string. It removes last 5 > characters from any string. > > Regards > Viktoras > > Barlow, Neil wrote: > > > Hi all, > > > > > > > > This is a simple question fo

Re: Another regular expression question

2003-03-20 Thread Carl Jolley
On Thu, 20 Mar 2003 [EMAIL PROTECTED] wrote: > Filename = "Base-02.04.1.20.5.002-xlite_katana_free.ndu"; > > I want to get extension of the file name which is ndu, but I always get > 04.1.20.5.002-xlite_katana_free.ndu instead of ndu. > > The sub is like: > > sub extension > { > my $path = s

Re: Problem with Net::FTP

2003-03-19 Thread Carl Jolley
On Wed, 19 Mar 2003, Koteshwar Rao A wrote: > > Hai , > > My name is eswar , I am in a process of automating the ftp process from > a windows worstation to Unix server, > > When I am using this Net::Ftp for this , I am getting the following > error, > > Can't locate object method

Re: Adding a WorkSheet to Excel using Win32::OLE

2003-03-14 Thread Carl Jolley
On Thu, 13 Mar 2003 [EMAIL PROTECTED] wrote: > > > I am trying to add a Worksheet to an Excel Workbook file. I can use the Add > method to put the sheet with its tab on the left hand side but I want to add its > tab on the RIGHT hand side. I have tried: > > $book->Worksheets->Add( After=

Re: Simple syntax question

2003-03-14 Thread Carl Jolley
On Thu, 13 Mar 2003, Mark A. Chalkley wrote: > Ok, a dumb question here (I must be having a brain halt...): > > Given the following snippet of code to load data from a file into a > hash, > > while( ) { /(.*)\,(.*)/ && ($hash{$1} = $2) }; > > > what does the '&&' do? > It's a logical AND operato

Re: environment variable issues

2003-03-14 Thread Carl Jolley
On Tue, 11 Mar 2003, jphipps wrote: > I am having problems retreiving some of the environment variables using cgi.pm > here is the code that I am trying to use, what the heck is wrong > > Code > declartions: > use CGI qw/:ALL/; > $cgi = new CGI; > > routine: > { > if (($cgi->http('request_method))

Re: Not matching a dot

2003-03-14 Thread Carl Jolley
On Mon, 10 Mar 2003, Andrew Mansfield wrote: > I want to match files that have no period in their filename. > > So far I have: > > use strict; > use warnings; > > my $start_dir = $ARGV[0] || "."; > use File::Find; > print "Temp file list:\n"; > find sub { > return unless -f; > my $file

Re: Regular Expression matching problem

2003-03-14 Thread Carl Jolley
On Sun, 9 Mar 2003, Electron One wrote: > Hello Everyone, > > If I have a file that contains this, > > test3.txt## > wilma > > wimagren was here > > twilma was type wilma > > wilma > > wilma > > wilma > > twowilm

Re: How do I edit the tab of an Excel worksheet?

2003-03-14 Thread Carl Jolley
On Fri, 7 Mar 2003, Joel Brockman wrote: > After I insert data in a worksheet. > > use Win32::OLE; > $Excel = Win32::OLE->new("Excel.Application"); > $Excel->{Visible} = 1; > $Book = $Excel->Workbooks->Add; > $Sheet = $Book->Worksheets(1); > $Range = $Sheet->Range("A1"); > $Range->{Value} = ['

Re: Parsing test file question

2003-03-14 Thread Carl Jolley
On Thu, 6 Mar 2003, James wrote: > Hi all, > > I have a test file which conatin words separated by > comma and I would like to process and print the result > to an ouput file. The output file should only have at > most 32 characters per line.If the line read is more > than 32 char, then the rest s

Re: Results per page

2003-03-14 Thread Carl Jolley
On Wed, 5 Mar 2003, Erich C. Beyrent wrote: > Hey folks, > > Looking for some ideas. I have a flat file database, which contains a > buttload of records. When I go get a bunch of records, I am running into a > problem where a huge number of records is taking a while to print to the > browser. M

Re: CALLED

2003-02-27 Thread Carl Jolley
On Thu, 27 Feb 2003, [iso-2022-jp] $B#t#a#g#u#t#i(B wrote: > Hi, > > Is there Perl built-in function, the reverse of "caller"? > Now I'm coding many many subroutines. > I like to get current name of subroutine just I'm in. > > ... > sub sub_1 { > my (@parm) = @_; > my ($pkg, $filename, $line

Re: Newbie Question

2003-02-10 Thread Carl Jolley
On Mon, 10 Feb 2003, Heberson Almeida wrote: > HI all!!! > > I want to change some strings inside a HTML files, but I am trying to do this using >a command listed for Perl for Unix. > > How can I change the string inside many html files using Perl for Win32 (5.6.X.X)??? > You haven't provided en

Re: Regex question

2003-02-06 Thread Carl Jolley
On Thu, 6 Feb 2003, Richard Morse wrote: > On 02/06/2003 2:09 PM, "Ben Gonzalez" <[EMAIL PROTECTED]> wrote: > > > All, > > > > I have a string that can contain any number from 0 to 1048575. > > > > I can verify that the numbers are digits like this: ^\d{1,7}$ > > > > The above regex matches any 1

Re: Regex question

2003-02-06 Thread Carl Jolley
On Thu, 6 Feb 2003, Ben Gonzalez wrote: > All, > > I have a string that can contain any number from 0 to 1048575. > > I can verify that the numbers are digits like this: ^\d{1,7}$ > > The above regex matches any 1 to 7 digits. It will ensure that the string > contains digits 0 to 999. > > I ne

Re: What's wrong with this?

2003-02-04 Thread Carl Jolley
On Mon, 3 Feb 2003, Dax T. Games wrote: > print "What is the number?\n\n"; > > %Number = (1=>"800" ,2=>"810",3=>"1600",4=>"1610"); > > foreach $Key(%Number) { > print " $Key\n"; > } > > print "New Number: "; > > I get: > > What is the number? > > 1 > 800 > 2 > 810 > 3 > 1600 > 4 >

Re: Search a free Perl debugger

2003-02-04 Thread Carl Jolley
On Mon, 3 Feb 2003 [EMAIL PROTECTED] wrote: > Hi, > > I have to debug my scripts. But i don't know a free Perl debugger. > Can you recommand me one. Have you tried the one that is built into perl? It's activated with the -d flag and the standard documentation contains information about it.

Re: determining if a scalar is an integer or not

2003-02-04 Thread Carl Jolley
On Fri, 31 Jan 2003, Andreas.Kamentz wrote: > > I'd like to supplement the suggestions that came from all sides with a little > subroutine which always worked for me determining whether the scalar is a number > (not only integer) and returning the number if it is one. Once having the $res > number

Re: determining if a scalar is an integer or not

2003-01-30 Thread Carl Jolley
On Thu, 30 Jan 2003, Sisyphus wrote: > > - Original Message - > From: "Andre van der Lingen" <[EMAIL PROTECTED]> > To: "Mundell R. (Ronald)" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Thursday, January 30, 2003 7:14 PM > Subject: Re: determining if a scalar is an integer or not > >

Re: determining if a scalar is an integer or not

2003-01-30 Thread Carl Jolley
On Thu, 30 Jan 2003, Andre van der Lingen wrote: > I would do it like this: > > if ($var / 1) { > print ("var: $var is: integer\n"); > } else{ > print ("var: $var is: string\n"); > } > > if $var is a string than the outcome = "0" so the if statement will > print that $var is a

  1   2   3   4   5   >