Re: Removing a space from file name

2025-02-19 Thread Smoot Carl-Mitchell via beginners
ver the current directory and returns every filename in the directory to the $_ variable. The '*" can be any glob pattern. e.g. for the specific jpg files in the example, I could have used <*.jpg> -- Smoot Carl-Mitchell System/Network Architect voice: +1 480 922-7313 cell:

Re: Removing a space from file name

2025-02-17 Thread Smoot Carl-Mitchell via beginners
space character and the .jpg ending. I made the $_ explicit for clarity. -- Smoot Carl-Mitchell System/Network Architect voice: +1 480 922-7313 cell: +1 602 421-9005 sm...@tic.com -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: When is qw used

2015-06-10 Thread Carl Inglis
Some modules import all their endpoints by default; other only export a subset, requiring you to explicitly request others. Carp does not, by default, export "cluck". Regards, Carl On 10 June 2015 at 13:40, rakesh sharma wrote: > Hi Krzysztof > > If that was the case , us

Re: ? getting appended to file name while writing o file

2015-03-20 Thread Carl Inglis
8.240.55) 56(84) bytes of data. > > --- 192.168.240.55 ping statistics --- > 2 packets transmitted, 0 received, 100% packet loss, time 11000ms > > Use of uninitialized value in index at ./pinglog.pl line 26, line > 4. > > > On Thu, Mar 19, 2015 at 5:19 PM, Satya Prasad Nemana > wrote:

Re: ? getting appended to file name while writing o file

2015-03-19 Thread Carl Inglis
It's not actually ending up with a ? character at the end - it's ending up with a new line character. Your terminal is (as Andrew implied) displaying a ? character for a character code outside the range of characters it knows it can display. Regards, Carl On 19 March 2015 at 11:

Re: why is if (! @ARGV) skipped

2014-11-18 Thread Carl Inglis
to... Be interested to know what you find. Regards, Carl On 18 November 2014 22:46, Harry Putnam wrote: > I'll probably be battered for general poor perlmanship but still > risking posting my whole script (fairly brief). > > > The problem I'm having with it, that I

Re: advice about event programming

2014-11-13 Thread Carl Inglis
s a significant issue then at least you'll gain experience in optimising your code! :) > > Hope that helps you get started. > > I think so, at least this proyect sounds more interesting to me than the > boring exercices to calculate leap years. > [chuckle] Yeah, it does indeed. Good luck. Carl

Re: advice about event programming

2014-11-13 Thread Carl Inglis
http://stackoverflow.com/questions/2232471/how-do-i-use-async-programming-in-perl http://search.cpan.org/~mlehmann/AnyEvent-7.07/lib/AnyEvent.pm Hope that helps you get started. Good luck. :) Regards, Carl On 13 November 2014 15:44, mailing lists wrote: > Hello all, > > I have

Re: async, non blocking tcp server

2014-08-29 Thread Carl Inglis
er level and not ACK the packets to force retransmission at the TCP level? (Clutching at straws a little here). Anyway, hope some of the thoughts and ideas does help you, and I'd be interested to know what you end up doing. Regards, Carl [big snip]

Re: async, non blocking tcp server

2014-08-29 Thread Carl Inglis
27;re looking for a single threaded solution to an implicitly multi-threaded problem. I can't see any way for a single thread to do what you want. Regards, Carl On 29 August 2014 09:32, Chris Knipe wrote: > On Fri, Aug 29, 2014 at 10:10 AM, Carl Inglis > wrote: > > I susp

Re: async, non blocking tcp server

2014-08-29 Thread Carl Inglis
g for something like this: http://www.perlmonks.org/?node_id=66135 In fact, it's specifically mentioned in the Perl Cookbook: http://docstore.mik.ua/orelly/perl/cookbook/ch07_15.htm Hope that helps put you on the right track. Regards, Carl On 29 August 2014 08:44, Chris Knipe wrote: &g

Re: Need to understand what this script does.

2014-08-10 Thread Carl Inglis
says that it's designed to validate and then convert some data. Carl

Re: Suddenly.... Part 2

2014-08-05 Thread Carl Inglis
ing the Everyone permissions you mention (I've seen that happen sometimes when there's been problems with the underlying directory permissions). Another thing which might help with Windows is trying an absolute path to avoid any path related problems. Hope that helps. Carl On 5 August

Re: find and multiline delete

2008-07-04 Thread Smoot Carl-Mitchell
my $skip_count = 0; while (<>) { chomp; if (/^Foo$/) { $found_foo = 1; print "$_\n"; next; } if ($found_foo) { $skip_count++; next if $skip_count <= 2; }

Re: Random Image and Cache problem

2007-09-03 Thread Carl Miller
\n"; # for HTTP/1.0 print "Expires: Fri, 26 Mar 2004 01:40:42 GMT\n"; print "Cache-Control: must-revalidate, max-age=1\n"; IE still caches. Can anyone give some insight into where the problem might be? Thanks. On 9/2/07 3:34 PM, "Mumia W." <[E

Random Image and Cache problem

2007-09-02 Thread Carl Miller
I'm trying to setup a simple random image script to allow other websites to display random banner ads located on my server. The other website would call the perl script in an tag, like so: http://www.my_site.com/cgi-bin/random_banner.cgi"; width="468" height="60"> I've tried several perl script

RE: Help with @INC

2007-02-24 Thread Carl Sajjan
/site/Mozilla/LDAP/Conn("$parm{'ldaphost'}", " $parm{'ldapport'}"); I gave the correct IP for ldaphost and 389 as port. Has anyone used this utility? Thanks in advance Carl -Original Message- From: Carl Sajjan [mailto:[EMAIL PROTECTED] Sent: Sunday

RE: Help with @INC

2007-02-24 Thread Carl Sajjan
/Mozilla/LDAP/ 133 /usr/ds/v5.2/nsPerl5.005_03/lib/site 134 ); 135 136 #use Mozilla::LDAP::Conn; 137 print (@INC, "\n\n"); 138 Output: (carl)(113): perl look.pl /usr/perl5/5.6.1/lib//sun4-solaris-64int/usr/perl5/5.6.1/lib//usr/iplane t/perl5/lib/site/Mozilla/LDAP//u

Help with @INC

2007-02-24 Thread Carl Sajjan
Please help me out. TIA Carl . The wise want love; and those who love want wisdom. --Percy Bysshe Shelley

read a directory

2005-02-28 Thread Carl Johnson
) { print OUT "$record"; } else { die "File Read Error on record $index: $numbytes bytes read; Should be 1200.\n"; } } close DIR; close OUT; Carl Johnson Principal Consultant 214-914-9509 - P 214-242-2020 - F [EMAIL PROTECTED]

ftp script

2004-12-01 Thread Carl Johnson
I'm very new to perl, can any share an example ftp script? I need to ftp from one server directory to another server to a directory Thanks C

Move file from one zip to another using Archive::Zip

2004-05-19 Thread carl
Hola, How do I remove a file from a zip file and add it to a different existing archive? From the Archive_Zip documentation I understand that I'm clobbering the existing archives when i use the code below. How do I not clobber them? thank you. use Archive::Zip qw( :ERROR_CODES :CONSTANTS );

Re: Finding the current IP of my laptop

2004-04-22 Thread Smoot Carl-Mitchell
vided your laptop has a valid host to IP address translation available. On Unix typically either an entry in /etc/hosts or a DNS A record entry. Take a look at Net::Interface on CPAN. It appears to let you look at interface information in a system independent way. -- Smoot Carl-Mitchell Sy

Re: Password Changer and rexec help

2004-04-22 Thread Smoot Carl-Mitchell
ss, since you do need the Tcl libraries to build the expect binary on Unix systems. I went thru that process around 1992 when I first discovered expect. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubscribe,

Re: Password Changer and rexec help

2004-04-21 Thread Smoot Carl-Mitchell
nctionality as expect, but is IMHO a bit more rational. BTW, expect is not written in Tcl. It uses Tcl syntax for flow control, but it is a separate language. The Unix version is written in C as is Tcl. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421

Re: Who is running my program?

2004-04-10 Thread Smoot Carl-Mitchell
On Sat, 10 Apr 2004 17:07:02 -0700 "Chance Ervin" <[EMAIL PROTECTED]> wrote: > Is there an easy way to check which user is running your scripts? See $< and $> in perlvar. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9

Re: flock return value / bit wise or'd LOCK_NB

2004-04-07 Thread Smoot Carl-Mitchell
et = flock(ZZZ, LOCK_EX | LOCK_NB); print "$ret $!\n"; sleep 60; > Thanks for the info BTW I really appreciate it! :) No problem. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubscribe, e-mai

Re: flock return value / bit wise or'd LOCK_NB

2004-04-07 Thread Smoot Carl-Mitchell
if($rc == 4) { warn "rats! Exclusive lock not granted, oh well..."; > } if(!$rc) { die "Could not get lock no how mr flock guy!"; } The return code with LOCK_NB is false if the file is locked by another process, true is you got the lock. $! holds the appropriate error message

Re: Perl/TK

2004-04-07 Thread Smoot Carl-Mitchell
st > with perldoc.com) and check out the FAQs > (http://www.lns.cornell.edu/~pvhp/ptk/ptkFAQ.html) and go from there. I concur with this assessment. Also the Perl/Tk module comes with some example programs which are also very useful learning tools. -- Smoot Carl-Mitchell Systems/Network A

Re: tracking mail logs

2004-04-05 Thread Smoot Carl-Mitchell
ntly has no copyright at all. If there is interest, I will do the work to GPL it and put it up on my FTP site. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Re: Using $_ in a function if no argument is passed

2004-04-03 Thread Smoot Carl-Mitchell
er in my original response, since I had never done such a thing in my own Perl coding and I was curious enough to come up with what turned out to be a buggy solution. Live and learn. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1

Re: Using $_ in a function if no argument is passed

2004-04-03 Thread Smoot Carl-Mitchell
On Sat, 3 Apr 2004 11:04:35 -0600 "Charles K. Clarkson" <[EMAIL PROTECTED]> wrote: > Smoot Carl-Mitchell <[EMAIL PROTECTED]> wrote: > : > >sub test { > : > > > : > > my $arg; > : > > $arg = shift or $arg = $_; > : > >

Re: Using $_ in a function if no argument is passed

2004-04-03 Thread Smoot Carl-Mitchell
On 3 Apr 2004 14:40:43 - [EMAIL PROTECTED] (Peter Scott) wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Smoot Carl-Mitchell) writes: > >On Fri, 02 Apr 2004 10:37:14 -0600 > >"JupiterHost.Net" <[EMAIL PROTECTED]> wrote: > > > &

Re: HOT: Search/Replace || and *|

2004-04-02 Thread Smoot Carl-Mitchell
$line =~ s/\*|/|/mg; > print NEWFILE "$line\n"; > } > close OLDFILE; > close NEWFILE; > > print "$newfile has now been created\n"; > } > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Using $_ in a function if no argument is passed

2004-04-02 Thread Smoot Carl-Mitchell
ther the given argument > or $_ how would you do that? $_ is global, so do something like: sub test { my $arg; $arg = shift or $arg = $_; } -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubs

Re: loop using backticks stalls after ~30x

2004-04-02 Thread Smoot Carl-Mitchell
copy of itself and is waiting for input or waiting to send output to the terminal or has been stopped. That is what the 'T' means in the ps listing. Are you sure you are executing /bin/ls and not some other ls program in your PATH? Try doing an strace on the stopped process and see wh

Re: Is this possible? (file handles)

2004-04-01 Thread Smoot Carl-Mitchell
ter opening it. The directory entry for the file is deallocated, but the file is still open. When the file is closed, the disk allocation for the file is reclaimed. This is a handy method for creating temporary files that you want to be sure get deallocatted when the program using the temporary f

Re: Check if another script running

2004-04-01 Thread Smoot Carl-Mitchell
king routine which explains how to use flock to grant exclusive access to a file. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

Re: Matching ranges of IP addresses

2004-03-31 Thread Smoot Carl-Mitchell
nvert the dotted decimal representation of each IP address to a number and do a direct numeric comparison. You might also take a look at the CPAN module Net::IP::Match. It looks like it does what you want to do unless you really want to code up your own solution from scratch. -- Smoot Carl-Mitchel

Re: How to determine if STDIN has piped data?

2004-03-31 Thread Smoot Carl-Mitchell
stead of reading or writing from a file, the program reads or writes a socket which is typically connected to another program via a network protocol which is either local or remote. See perldoc -f socket. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421

Re: determing number of records returned with DBI

2004-03-30 Thread Smoot Carl-Mitchell
rds) { > ... > } $#records returns the index of the last element in the array. @records in scalar context returns the number of elements in the array. With array indices starting at zero, #$records + 1 == @records. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PR

Re: problem with fork & wait

2004-03-29 Thread Smoot Carl-Mitchell
$pid1=wait; > } The above works, but it is equivalent to: system("XYZ -a $check"); You should check the return value of system. A non-zero value means the forked program returned a non-zero exit status which depending on what you do with the output may or may not be an error. -- Smoo

Re: Incrementing count

2004-03-29 Thread Smoot Carl-Mitchell
unter. % is the modulo operator. See perlvar for the details on $. and perlop for the modulo operator. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: string change problem

2004-03-29 Thread Smoot Carl-Mitchell
On Mon, 29 Mar 2004 12:14:49 -0600 James Edward Gray II <[EMAIL PROTECTED]> wrote: > On Mar 29, 2004, at 11:02 AM, Smoot Carl-Mitchell wrote: > > > On Mon, 29 Mar 2004 15:05:34 +0530 > > "MuthuKumar" <[EMAIL PROTECTED]> wrote: > > > >>

Re: How to determine if STDIN has piped data?

2004-03-29 Thread Smoot Carl-Mitchell
my simple Perl tools with the following paradigm: process any flags here while (<>) { do something with the input } The magical <> operator is very handy. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313

Re: string change problem

2004-03-29 Thread Smoot Carl-Mitchell
something like: $name =~ s/\d+.*//; which matches one or more digit characters followed by anything. See the perlre man page for details on Perl regular expressions. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To uns

Re: How to determine if STDIN has piped data?

2004-03-28 Thread Smoot Carl-Mitchell
; { > print $_ . "\n"; > } You can use the POSIX module's isatty function. Something like: use POSIX qw(isatty); exit 0 if isatty(STDIN); If STDIN is not a tty then it must be a pipe. Alternatively, you can use the '-t' operator: exit 0 if -t STDIN -- S

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread Smoot Carl-Mitchell
} Write get_mail_header to return the next valid header or undef at the end of the headers. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Home made mail news search tool, and folded header lines

2004-03-27 Thread Smoot Carl-Mitchell
velope information. So it is easy to generate a technically illegal message. Also note that any header can be folded, although it is typically only the Received: headers which are routinely wrapped for readability. As usual when writing code against a protocol standard, be liberal in what you will accep

Re: serial console with perl

2003-10-22 Thread Smoot Carl-Mitchell
>error. Any ideas ?? Look at the Expect module. It gives you the ability to automate interactive tasks. -- Smoot Carl-Mitchell Systems/Networking Consultant email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: alias in the shell

2003-10-18 Thread Smoot Carl-Mitchell
the quoting gets really convoluted > > No kidding... Sometimes the list form of system() makes this easier, > and non-interpolating quotes always help. > > system qw(ksh -c), 'TEST=hello; echo $test'; Good point. This does make it easier to read. In your example $test should

Re: alias in the shell

2003-10-17 Thread Smoot Carl-Mitchell
Note the quoting gets really convoluted, since you have to worry about Perl's quoting conventions and two layers of shell quoting. Anything more complicated than this short example and I would go ahead and create a shell script and call it explicitly. Better, yet, write the shell functionality i

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

[OT] Weekly posting statistics - 24/2002

2002-06-18 Thread Carl Franks
I think that also including how many original articles had a reply, and how many had no reply, would be a useful statistic which would show the level of (or lack of) line noise. This data might be used to advertise the quality of the list, maybe at http://learn.perl.org Thoughts? Carl

Re: PROBLEM WITH THE USES OF USE STRICT

2002-04-09 Thread Carl Franks
the end of the input, which just so happens to work while you're running this from the shell, but may not be what you want in other situations. Cheers, Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Updating multiple frames in one CGI processing cycle

2002-03-28 Thread Carl Franks
Ted You could either send a new frameset page, which will load both new frames you require, or you'll have to use a client side scripting language (i.e. javascript) Here's a link that shows one way to do it: http://javascript.internet.com/navigation/change-2-frames.html Carl --

Re: Might be OT. Making a webpage.

2002-03-25 Thread Carl Franks
Here's the 'manual' http://www.perldoc.com/perl5.6.1/lib/CGI.html probably a little easier than trying to read the .pm file. Print it out and keep it next to your keyboard at all times :) -- >From: Tor Hildrum <[EMAIL PROTECTED]> >To: Perl <[EMAIL PROTECTED]> >Subject: Re: Might be

Empty compile time value given to use lib

2002-03-07 Thread Carl Schoeneman
Hola, I'm using "use lib" dynamically: $script_dir = get_lib(); use lib "$script_dir"; This works but generates the warning "Empty compile time value given to use lib." Is there any way to supress this message without disabling warnings entirely? Th

Re: finding max value

2002-02-14 Thread Carl Franks
7;t test this myself, I'm at a computer w/out perl :O !! Cheers, Carl Please don't cc me. I'm on the list. > > my @bob = rand for (1..20); > my @joe = rand for (1..10_000); > sub maxOne > { > my $max = (sort {$b<=>$a} @bob)[0] > } > sub maxTwo > {

Re: run from command line

2002-02-07 Thread Carl Rogers
At 03:58 PM 2/6/2002 -0600, Booher Timothy B 1stLt AFRL/MNAC wrote: >Hello. I am trying to run a simple command to remove all the leading spaces >from a file and it just isn't working. No errors, just no results - still a >lot of leading spaces on each line. > >%perl -pi.bak -e 's/^\s+//' bomb1.tx

Accessing previous element of an array in a 'foreach' loop

2002-02-06 Thread Carl Rogers
op. Thank you very much for your time. Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Kinda OT.. Updating Perl/Installing modules on a large network

2002-02-06 Thread Carl Rogers
or your time, in advance. Sincerely, Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Prining hash of hash values

2001-12-18 Thread Carl Rogers
ues as well as the second lot of keys >and values. > > >foreach $username (keys %allusers) {print $username, "\n";} I don't have Perl up and running, and I'm a real donkey when it comes to complex stuff like this, but what would happen if you did keys(%USER)?? Hope I'm not wasting your time and the time of others. Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: output into a csv file

2001-12-17 Thread Carl Rogers
At 02:18 PM 12/17/2001 -0800, Scott Lutz wrote: >I was looking for more of a way to print out the array, with inserting a >comma (,) between every array value, like >while ( @output ) { > print $output[position] ."," >} You can also assign the special variable "$," the value "," and it wi

RE: Finding 'probable' duplicate records

2001-12-07 Thread Carl Rogers
Hey John; Thanks for the help At 08:44 AM 12/7/2001 -0500, [EMAIL PROTECTED] wrote: >Carl, > > I don't have a lot of Perl-specific advice, but if it's possible to >dependably parse each line into the component fields (last name, first name, >street address, et

Finding 'probable' duplicate records

2001-12-06 Thread Carl Rogers
for a substitution (i.e.: $result = () = $_ =~ /$seen{$_}/g; or something like that??), but I'm afraid that as soon as there is a single difference between the two, $result will be 0 (false). Am I barking up a beanstalk??? I hope this makes sense. Any and all help is greatly appreciated. Thanks, Carl --

Re: FW: Long variable again

2001-12-06 Thread Carl Rogers
At 02:09 PM 12/6/2001 +1030, Daniel Falkenberg wrote: > > Hey again all! > > > > $string = "attack. The password for $user_to_change should not have > > to be changed.\n". > > "-" x 70, "\n Hello". > > "Thank you for using our software.\n\n"; > > > > Now I have been informed t

Re: appending to a file a 'match' string, PLS HELP!.

2001-12-04 Thread Carl Rogers
At 09:10 AM 12/5/2001 +0800, louie miranda wrote: > open(INFO, $file); $file has a value, right? Add this: open(OUTFILE, ">>$append") or die "Can't open file:$!\n"; #this is assuming you've assigned a file name to $append > @lines = ; > close(INFO); >

Fwd: Re: I thought I knew....

2001-11-29 Thread Carl Rogers
7;m still hoping to advance past the beginner stage one day. Good day >Date: Thu, 29 Nov 2001 18:32:45 -0500 >To: <[EMAIL PROTECTED]> >From: Carl Rogers <[EMAIL PROTECTED]> >Subject: Re: I thought I knew > >At 03:20 PM 11/29/2001 -0800, A. Rivera wrote: >>OK,

Re: I thought I knew....

2001-11-29 Thread Carl Rogers
At 03:20 PM 11/29/2001 -0800, A. Rivera wrote: >OK, I have this.. > >$longdate="Fri November 29, 2001"; >And I want just the November 29, 2001 part. How about $longdate =~ /(\w+\s)/; $longdate =~ s/$1//; Not too elegant, but it works for this example, I think -- To unsubscribe, e-mail: [EMAIL

RE: newlines

2001-11-29 Thread Carl Rogers
't want it to. > >Can you change a delimiter? Sure.. Do it before your while statement. And it will remain that way throughout your loop. It can be changed to anything (commas, semicolons, or even strings (I think)) Hope this helps. Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: file test

2001-11-29 Thread Carl Rogers
n directory to see if they AREN'T executables? In WIN NT: foreach (`dir /B`) # gives bare format of the files in the working directory { if ($_ !~ m/\.exe/) { ## do whatever you want to the files that aren't .exe } else

Re: newlines

2001-11-29 Thread Carl Rogers
At 10:35 AM 11/29/2001 +, [EMAIL PROTECTED] wrote: >Anyone know how to get rid of two new lines from one text file before >writing to another I'm sorry.I'm not clear as to what you mean. If you're trying to read the lines below, you can change your default record delimiter from a single new

RE: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Schoeneman, Carl
San Diego, California, dude. -Original Message- From: Etienne Marcotte [mailto:[EMAIL PROTECTED]] Sent: Friday, November 09, 2001 7:08 AM To: [EMAIL PROTECTED] Subject: Off-Topic (200%) - Where are you from? By reading the messages everyday I can guess most of us are from United States r

Re: Foreach question

2001-11-01 Thread Carl Rogers
>What I'd really like to do though is to be able to write back(append) >to the same file.I am confused about opening a file in the append mode. Not sure if this is what you mean, but open (MYFILE, ">>file_to_append_to.txt") or die "Can't open $!\n"; Will open a file in the append mode Then

RE: Win32::Setupsup -Can Mouse action be sent to a window as SendKeys sends some key strokes to a window

2001-10-19 Thread Carl Jolley
On Fri, 19 Oct 2001, Abhra Debroy wrote: > Thank u Carl for the reply ! But what's the solution for the application > those do not support OLE . > If you have a Win32 OS then you have OLE. AutoIt will also run standalone with its own scripting language. Perhaps you misunderst

Re: Win32::Setupsup -Can Mouse action be sent to a window as SendKeys sends some key strokes to a window

2001-10-18 Thread Carl Jolley
On Thu, 18 Oct 2001, Abhra Debroy wrote: > Hi All > We can send some key strokes to a window by SendKeys function in > Win32::Setupsup. > How can we send mouse action to a window ? Is there any function available > in win32::Setupsup for the mouse action job. You can use Win32::OLE as a way to g

Pad Number with Leading Zeros

2001-09-26 Thread Schoeneman, Carl
f; $g =~ s/ /0/g; print "$f\n"; print "$g\n"; ~Carl

Re: regex: can't match pattern... dang

2001-09-04 Thread Carl Rogers
Good day; I have the following strings: > rootWed Aug 22 04:44:59 2001 DLs >I want three things: > >user, the entire date, the state. What is separating these attributes? A constant number of spaces, or a tab? If so, it might be easier to use the "split" function. ($user, $date, $

RE: Confusion with Regular Expressions

2001-08-30 Thread Carl Rogers
>There must be a way of >defining a character class using the ascii values instead of the actual >character. I just don't know how to do it. If you refer to the ASCII value in it's hexadecimal equivalent (i.e.: 'A-Z ' is equivalent to [\x41-\x5A]) that should do

Looking for help with the Translate operator

2001-08-23 Thread Carl W Rogers
= "1/2"; $variable =~ tr/[\xBD]/$replacement/; #tr replaces \xBD with 'r', then I tried $variable =~ tr/[\xBD]/\$replacement/; # just to see if the \ in front of the $ would work.. It didn't May be a total brainfart, but I'm stumped. I appreciate any advice. Thank yo

Re: GET ME OFF

2001-08-21 Thread Carl Rogers
This *should* get you off: To unsubscribe, e-mail: [EMAIL PROTECTED] If it doesn't, let the list guru's know and they can work their magic. PS: I wondered if I was reading the subject line correctly:) At 07:33 PM 8/21/2001 +0200, Miriam Hadary wrote: >DEAR EVERYONE, > >I HAVE REALLY TRIED TO

RE: Remove White Space

2001-08-06 Thread Carl Rogers
At 01:49 PM 8/6/2001 -0700, Wagner-David wrote: > Should be ^ not $ to remove leading and \s+$ to remove trailing. To quote a famous philosopher: D'OH (The hamster falls off the wheel if he's not paying attention) My bad and my sincere apologies.. Thanks for the correction.

Re: Remove White Space

2001-08-06 Thread Carl Rogers
At 04:13 PM 8/6/2001 -0400, Scott Martin wrote: >How can I remove white space from the beginning of a variable? $variable =~ s/$\s+//; removes one or more spaces in the beginning HTH -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Problem with HEX numbers and ucd-snmp perl module...

2001-08-06 Thread Carl Rogers
At 04:22 PM 8/6/2001 -0200, Hamish Whittal wrote: >Hi all, > >I am using Joe Marzot's perl module 4.2.0. I am doing a walk of a >variable that returns a hex value. Problem is, I have no idea the value >will be hex, till I try to print it. 2 questions: > >1. I think I could find a hex value by test

Re: If Statement won't work

2001-08-03 Thread Carl Rogers
At 11:22 AM 8/2/2001 -0500, [EMAIL PROTECTED] wrote: >Can anyone tell me why my if statement refuses to work? It is really >simple. I can't understand it. > >$winner = 1; >if($winner == 1){ >print "$winner\n"; >} Are you expecting the word "winner" to appear??? I've sometimes got so lost in c

Re: input output append

2001-08-03 Thread Carl Rogers
Good afternoon; >HI, >anyone knows the right syntax for reading and writing (appending) to a file. >I tried this and it didn't seem to work >open (FH,"+< file.txt" ) Try: open (FH,">> file.txt" ) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Can Perl be used to develop test scenarios?

2001-08-01 Thread Carl Rogers
from this list would know how. (I try to do as much as I can in Perl) On the other hand, if there is a different tool out there that will help me accomplish this, I would appreciate knowing about it. Thanks to everyone in advance. Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Deleting Duplicate Lines one-liner

2001-07-30 Thread Carl Rogers
it) while (){ if (not $seen{$_}) { $seen{$_} = 1; print OUTFILE; } else { } } I wish I could tell you why/how it works (I'm *still* working my way up to newbie status), but it does. (Magic??).. It'll take longer for big files, but again, it does the t

Extracting data from text files using Perl

2001-07-24 Thread Carl Rogers
ange in size from 25-66MB) off line if desired. Sincerely, Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: regexp issues

2001-07-23 Thread Carl Rogers
Good day, Stephanie; At 01:46 PM 7/23/2001 -0700, Stephanie Stiavetti wrote: >I need to make sure that a field contains ONLY letters... and this is the >regular expression I'm using: > >$name=~/^[a-zA-Z]+/ > > >it doesn't seem to be working in the test script that I wrote: Your test script worke

Re: counting regex matches

2001-06-14 Thread Carl Rogers
> >$string =~ /a/g; # match on all 'a' in $string > >Now how do I know how many times it actually matched? Try: $result = $string =~ /a/g; The value will be in $result Carl

Question regarding the Substitution Operator

2001-06-13 Thread Carl Rogers
can it be done with one statement like I tried above?? I've tried placing [ ] around each variable, using the || operator between each variable- nothing seems to work. Any and all help would be greatly appreciated. Sincerely, Carl PS: I know: There are no dumb questions. Only questions asked by dumb people! :)

Re: Substitution Problem

2001-06-08 Thread Carl Rogers
Good day; At 05:01 PM 6/8/2001 +, Mark Martin wrote: > > if ($doc == " "){ > > doc =~ s/ /11/; should be: $doc =~ s/ /11/; #don't forget the "$" Also, try $doc =~ tr/ /11/; Being a newbie myself, I stumb

Re: problem saving binary data

2001-06-05 Thread Carl Rogers
At 11:38 AM 6/5/2001 -0500, Jeff Davis wrote: >I'm using LWP to fetch an image and attempting to save it locally. >The file is successfully created, however all it contains is: > >HTTP::Response=HASH(0x8380464) > > >Here's the code snippet: > > $file = "/home/images/$name"; > open(IMAGE, ">$file

Re: Substring retrieval

2001-06-05 Thread Carl Rogers
Good day; At 08:17 AM 6/5/2001 -0700, Paul wrote: >--- Nathaniel Mallet <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'm trying to retrieve a substring from a string, but I'm not > > sure exactly where and how big that substring is. The substring is > > delimited by a start and end special char

Beginners Training books

2001-06-04 Thread Carl Barnes
To beginners community What book(s) do you consider the best for gaining experience in using Perl. I have been a visual basic programmer, and dabbled with C++, but Perl seems to pull the best of all of these tools into 1, plus the pay is not bad for Perl developers. Anxious to learn. cb

Re: append a file to another file

2001-06-01 Thread Carl Rogers
indows- unix would be different open (INPUT) or die; while ($line = ) { print OUTPUT $line; }## END WHILE } ## END FOR EACH } ## END IF I think this will work (not sure...) but I hope this helps. Carl At 02:30 PM 6/1/2001 -0500, Nichole Bialczyk wrote: >i understand how to open and create file

Re: test for real number

2001-05-30 Thread Carl Rogers
input, you can tweak the \d to suit your needs. Hope this helps/works. Carl At 01:56 PM 5/30/2001 -0700, you wrote: >Hi, >I'm new to the group and new to Perl and am very glad to have such a >resource available. Hopefully someday I'll be on the giving end of the >help list b

Re: Simple question

2001-05-29 Thread Carl Rogers
Not 100% sure, but $check[0] will never equal " " due to your split command.. At 05:25 PM 5/29/2001 -0400, [EMAIL PROTECTED] wrote: >Hi All, > I am working on the following output. > >* /ebppvobstore/vobs/Core /ebppvobstore/vobs/aci.vbs public >* /ebppvobstore/vobs/UCMCQ /ebppvobstore/vo

  1   2   >