Re: Hi, newbie question

2002-07-23 Thread Yasen Petrov
Hello, I don't think that the file matters. You say it's a massive line. To read a file you should first open it. Look at PerlDoc. "Desmond Lee" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi guys > > I'm trying to read a file, but it's just one massive l

Re: Net::SMTP

2002-07-23 Thread Sudarshan Raghavan
On Tue, 23 Jul 2002, Manya wrote: > > > Have you installed Net::SMTP, it comes as a part of libnet package. > > If you have installed it check that the install directory is a > > part of the @INC array. > > > > How to check if a module is installed or not ? If you are getting an error like 'Ca

Re: How to expand Unix command in echo statement?

2002-07-23 Thread Steve Grazzini
Nkuipers <[EMAIL PROTECTED]> wrote: > > or something along those lines. in any case I have been under the > impression that calls to the system are more appropriately made like > this: > > system "date"; > > than this: > > `date` > > though I can't remember what gave me that impression. =)

Re: Please help with Database issue

2002-07-23 Thread Garry
Thanks Jenda and George, Considering the hosting company is a rather large conglomerate, and their answer to any question I have regarding databases is to send me to their helpfile, which does not mention databases or Perl anywhere, it might be time to change who I am giving my monthly fees to...

Re: Please help with Database issue

2002-07-23 Thread Wiggins d'Anconia
> > Could you ask them if they would install (or have already installed) > DBI and DBD::CSV or DBD::File? > You could then convert your database to flat files or CSVs on your > side (by a Perl script that would just connect the Access via > DBD::ODBC, the CSVs/Files, and would copy all tables

Re: Net::SMTP

2002-07-23 Thread Wiggins d'Anconia
Manya wrote: >>Have you installed Net::SMTP, it comes as a part of libnet package. >>If you have installed it check that the install directory is a >>part of the @INC array. >> > > > How to check if a module is installed or not ? > Depends on what system you are on. In your original message t

Re: How to expand Unix command in echo statement?

2002-07-23 Thread George Schlossnagle
Ick. If you want to shell program you should just program shell. How about: my $log="/tmp/ito.log"; open LOG, ">$log"; chomp (my $date = scalar localtime); print LOG "[$date] Warning: some text\n"; On Tuesday, July 23, 2002, at 06:43 PM, kent ho wrote: > Please help. I want to expand the "da

RE: How to expand Unix command in echo statement?

2002-07-23 Thread nkuipers
>$log="/tmp/ito.log" >`echo Warning: some text > $log` > >I need to expand the "date" command somewhere in this echo command, please >show me how. the perl localtime function returns the same information as a unix date command. printing to an append filehandle in perl is similar to echoing to a

How to expand Unix command in echo statement?

2002-07-23 Thread kent ho
Please help. I want to expand the "date" command in the echo command: Ex: $log="/tmp/ito.log" `echo Warning: some text > $log` I need to expand the "date" command somewhere in this echo command, please show me how. Thanks, kent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: Please help with Database issue

2002-07-23 Thread George Schlossnagle
> Even better option might be DBD::SQLite. That's a "whole" SQL > compatible database in Perl module. It is quicker than > DBD::CSV/DBD::File and the whole database is just one file, just like > Access. Wow, learn something new everyday. Very cool. > > That way you do not have to upload tens of

Re: Please help with Database issue

2002-07-23 Thread George Schlossnagle
I'm putting this back on-list since other people may be interested in continuing this thread. If you already have all this information in an access db and you like access, I would recommend finding a hosting provider that will host your access app. Alternatively, a provider that would provide

Re: Please help with Database issue

2002-07-23 Thread Jenda Krynicky
From: "Garry" <[EMAIL PROTECTED]> > I sure hope I am posting in the right place, the "beginners" > definitely applies here. > > I have a web hosting account and my ISP has the following Perl modules > installed: > > AnyDBM_File,pm > db_file > NDBM_File.pm > ODBM_File.pm > SDBM_File.pm > gdbm_fil

Re: Please help with Database issue

2002-07-23 Thread George Schlossnagle
On Tuesday, July 23, 2002, at 04:06 PM, Garry wrote: > Hello everyone, > > I sure hope I am posting in the right place, the "beginners" definitely > applies here. > > I have a web hosting account and my ISP has the following Perl modules > installed: > > AnyDBM_File,pm > db_file > NDBM_File.pm >

Re: Crypt::Cracklib?

2002-07-23 Thread George Schlossnagle
To make a comment more to your intent, I just installed Crypt::Cracklib. It seems to work fine. It's not particularly slow, so unless there is a reason you want to supplement it, I would just run with the cracklib checks. On Tuesday, July 23, 2002, at 04:10 PM, George Schlossnagle wrote: >

Please help with Database issue

2002-07-23 Thread Garry
Hello everyone, I sure hope I am posting in the right place, the "beginners" definitely applies here. I have a web hosting account and my ISP has the following Perl modules installed: AnyDBM_File,pm db_file NDBM_File.pm ODBM_File.pm SDBM_File.pm gdbm_file perl5db.pl They have a statement on th

Re: How to make @array2 use values of @array1?

2002-07-23 Thread Michael Fowler
On Mon, Jul 22, 2002 at 11:13:23PM -0700, nkuipers wrote: > What I am about to raise, I do so more out of wanting someone to educate me > than disagreeing for the sake of. The *that syntax shown below is unfamiliar > to me outside the context of referencing a filehandle in a subroutine params

Re: Crypt::Cracklib?

2002-07-23 Thread George Schlossnagle
Probably not the input you're looking for but: If your page is in php, why are you passing it to a perl script? Having to maintain things in two languages is a pain, you invariably end up with large amounts of duplicated code. Maintaining redundant code in 1 language is hard enough, maintai

RE: Crypt::Cracklib?

2002-07-23 Thread Nikola Janceski
I just checked CPAN and found: http://search.cpan.org/doc/DANIEL/Crypt-Cracklib-0.01/Cracklib.pm and there is a good example right there, but there isn't much documentation. That's all the input I can supply. > -Original Message- > From: Batchelor, Scott [mailto:[EMAIL PROTECTED]] > Sen

RE: Crypt::Cracklib?

2002-07-23 Thread Batchelor, Scott
Anyone have any input on this? Scott -Original Message- From: Batchelor, Scott Sent: Tuesday, July 23, 2002 12:07 PM To: [EMAIL PROTECTED] Subject:Crypt::Cracklib? Does anyone have any experience with this module? Basically I have a PHP page which is passing a u

Re: pushd and popd

2002-07-23 Thread John W. Krahn
"John W. Krahn" wrote: > > "Shishir K. Singh" wrote: > > > > > > 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? >

Re: How to parse a full pathname into dir, file, ext?

2002-07-23 Thread chris
I get it. Thank you use File::Basename; my $os_string = "MSWin32"; fileparse_set_fstype($os_string); my $fullfilename = "c:\\windows\\system32\\kernel32.dll"; my ($name,$path,$suffix) = fileparse($fullfilename, '\..*'); $suffix =~ s/\.//g; print "$name\n" . "$path\n" . "$suffix\n"; -- To unsubs

RE: Cut string between the words

2002-07-23 Thread David Gerler
Thanks to all that posted... very informative.. and helpful. David Gerler Gerler Enterprises PO BOX 16357 Chesapeake VA 23328 http://www.GerlerEnterprises.com/ Nationwide Dial-up from $12.45 http://www.EasySitesForLess.com/ -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PR

Re: pushd and popd

2002-07-23 Thread drieux
On Tuesday, July 23, 2002, at 11:39 , Shishir K. Singh wrote: [..] > I have this awfully old shell script that used lots of pushd and popd and > I need to convert it to perl. I will have to settle with push and pop and > cwd for the time being. Thanks anyways !! traditionally pushd/popd are cs

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 -

Re: pushd and popd

2002-07-23 Thread John W. Krahn
"Shishir K. Singh" wrote: > > > > 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 >

RE: How to parse a full pathname into dir, file, ext?

2002-07-23 Thread Shishir K. Singh
> Given a full pathname c:\windows\system32\kernel32.dll >I need to parse this into a directory, file, and extension >my $fullfilename = "c:\\windows\\system32\\kernel32.dll"; >breaks down into the following >my $dir = "c:\\windows\\system32\\"; >my $file = "kernel32"; >my $ext = "dll"; Fil

RE: How to parse a full pathname into dir, file, ext?

2002-07-23 Thread nkuipers
>= Original Message From chris <[EMAIL PROTECTED]> = >Given a full pathname c:\windows\system32\kernel32.dll > >I need to parse this into a directory, file, and extension > >my $fullfilename = "c:\\windows\\system32\\kernel32.dll"; > >breaks down into the following > >my $dir = "c:\\window

How to parse a full pathname into dir, file, ext?

2002-07-23 Thread chris
Given a full pathname c:\windows\system32\kernel32.dll I need to parse this into a directory, file, and extension my $fullfilename = "c:\\windows\\system32\\kernel32.dll"; breaks down into the following my $dir = "c:\\windows\\system32\\"; my $file = "kernel32"; my $ext = "dll"; -- To unsub

RE: Cut string between the words

2002-07-23 Thread David Gerler
Thanks Shawn, but I need to basically split the string into two strings between the words. I need to put the second half of the string into another string. That may help with some future scripts though. Thanks for pointing it out. David Gerler Gerler Enterprises PO BOX 16357 Ches

RE: One Liner Problems

2002-07-23 Thread nkuipers
>= Original Message From "Balint, Jess" <[EMAIL PROTECTED]> = >Hello. What is wrong with this? > >perl -e 'for(1..300){sleep 1;print ".";}' > >It never prints anything. >Thanks. I wrote a script like this: for (1..5) { sleep 1; print "."; } when i ran it, i timed it. it took

RE: One Liner Problems

2002-07-23 Thread Jeff 'japhy' Pinyan
On Jul 23, Balint, Jess said: >Is there a command line switch for that? To automatically place a newline after every print(), use the -l switch. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan

Re: One Liner Problems

2002-07-23 Thread George Schlossnagle
STDOUT is line-buffered. either unbuffer it ($| = 1;) or use stderr perl -e 'for(1..300){sleep 1;print STDERR ".";}' On Tuesday, July 23, 2002, at 02:37 PM, Balint, Jess wrote: > Hello. What is wrong with this? > > perl -e 'for(1..300){sleep 1;print ".";}' > > It never prints anything. > Thank

Re: Cut string between the words

2002-07-23 Thread Jeff 'japhy' Pinyan
On Jul 23, Jeff 'japhy' Pinyan said: > if (length($str) > 85) { >$str =~ s/(.{0,85})(?<=\S)(?!\S).*/$1/s; > } That can be $str =~ s/(.{0,84}\S)(?!\S).*/$1/s; > use Regexp::Keep; > $str =~ s/.{0,85}\K(?<=\S)(?!\S).*//s; And that would be $str =~ s/.{0,84}\S\K(?!\S).*//s; The Rege

RE: One Liner Problems

2002-07-23 Thread Balint, Jess
Is there a command line switch for that? -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 23, 2002 2:50 PM To: 'Balint, Jess'; '[EMAIL PROTECTED]' Subject: RE: One Liner Problems output is buffered. try it like this perl -e 'for(1..300){sleep 1;pr

RE: One Liner Problems

2002-07-23 Thread Nikola Janceski
output is buffered. try it like this perl -e 'for(1..300){sleep 1;print ".\n";}' > -Original Message- > From: Balint, Jess [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 23, 2002 2:37 PM > To: '[EMAIL PROTECTED]' > Subject: One Liner Problems > > > Hello. What is wrong with this? >

Re: One Liner Problems

2002-07-23 Thread Jeff 'japhy' Pinyan
On Jul 23, Balint, Jess said: >Hello. What is wrong with this? > >perl -e 'for(1..300){sleep 1;print ".";}' > >It never prints anything. >Thanks. Yes it does. It prints ".

RE: Cut string between the words

2002-07-23 Thread nkuipers
>I figure that I can use substr() to cut up a string, but how do I make it >between words? you can split the string on whitespace, for one. my @array = split /\s+/, $string; >How do I measure a string to see if it is greater than 85 characters? my $string_len = length($string); >Basically, if

Re: Cut string between the words

2002-07-23 Thread Jeff 'japhy' Pinyan
On Jul 23, David Gerler said: >How do I measure a string to see if it is greater than 85 characters? Using length(). if (length($str) > 85) { ... } >Basically, if the string is more than 85 characters, how do I break it at >the last full word? Well, it depends what you call a "word". Let's

One Liner Problems

2002-07-23 Thread Balint, Jess
Hello. What is wrong with this? perl -e 'for(1..300){sleep 1;print ".";}' It never prints anything. Thanks. Jess -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Cut string between the words

2002-07-23 Thread John W. Krahn
David Gerler wrote: > > I figure that I can use substr() to cut up a string, but how do I make it > between words? > > How do I measure a string to see if it is greater than 85 characters? > > Basically, if the string is more than 85 characters, how do I break it at > the last full word? $stri

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 >perld

Re: pushd and popd

2002-07-23 Thread John W. Krahn
"Shishir K. Singh" wrote: > > 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 perldo

Re: Cut string between the words

2002-07-23 Thread Shawn
Check out Text::Wrap on CPAN. http://search.cpan.org/doc/MUIR/Text-Tabs+Wrap-2001.0131/lib/Text/Wrap.pm Shawn - Original Message - From: "David Gerler" <[EMAIL PROTECTED]> To: "Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, July 23, 2002 1:16 PM Subject: Cut string between the words >

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
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 Jeff 'japhy' Pinyan
On Jul 23, Shishir K. Singh said: >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. -- Jeff "japhy" Pinyan [EMAIL PROTECTED]

RE: pushd and popd

2002-07-23 Thread Kipp, James
how about functions like push, pop, shift, unshift ? > -Original Message- > From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 23, 2002 2:15 PM > To: [EMAIL PROTECTED] > Subject: pushd and popd > > > I was just wondering if there is anything similar in perl for > u

RE: system() error return codes

2002-07-23 Thread Bob Showalter
> -Original Message- > From: Bob Green [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 23, 2002 9:11 AM > To: [EMAIL PROTECTED] > Subject: system() error return codes > > > I need to execute DOS level commands from perl and I must be > able to test > for success. > I've found the syste

Cut string between the words

2002-07-23 Thread David Gerler
I figure that I can use substr() to cut up a string, but how do I make it between words? How do I measure a string to see if it is greater than 85 characters? Basically, if the string is more than 85 characters, how do I break it at the last full word? David Gerler Gerler Enterprises PO BOX 16

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]

system() error return codes

2002-07-23 Thread Bob Green
I need to execute DOS level commands from perl and I must be able to test for success. I've found the system() function and it seems to work except I'm having problems getting the correct error return back. To test the error return I've created this very simple code. In it I try everything I kno

Re: Net::SMTP

2002-07-23 Thread Manya
> Have you installed Net::SMTP, it comes as a part of libnet package. > If you have installed it check that the install directory is a > part of the @INC array. > How to check if a module is installed or not ? Manya --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (

Re: Need help with package

2002-07-23 Thread drieux
On Tuesday, July 23, 2002, at 09:45 , chris wrote: > You are correct. perchance, but I will accept that as "oh, well that's worth ripping off and reusing" as being more accurate... > I will follow your advice. may I recommend that you limit following my advice to only the 'useful p

Crypt::Cracklib?

2002-07-23 Thread Batchelor, Scott
Does anyone have any experience with this module? Basically I have a PHP page which is passing a username and password to a perl script that does some preliminary checking...then I want to call cracklib to do the rest... Does anyone have a good example of how to do this. Everything is working

Re: Need help with package

2002-07-23 Thread chris
You are correct. I will follow your advice. Maybe I am making things more difficult for myself. On Tue, 23 Jul 2002 07:26:28 -0700, [EMAIL PROTECTED] (Drieux) wrote: >why pass in an uninitialized value??? that is >scoped to pass out of existence > >also this blessed "object" gambit should

RE: Can IPC work?

2002-07-23 Thread Pritpal Dhaliwal
can they share variables using pipes? I am new to this list and don't know a lot about perl, but I think you could use pipes in perl. Pritpal Dhaliwal -Original Message- From: David T-G [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 23, 2002 2:52 AM To: perl beginners Cc: May

RE: sorting %hash entries

2002-07-23 Thread David . Wagner
Switch the $a and $b and now you go to descending sequence: foreach my $MyId (sort {$b->[1] <=>$a->[1]} map{[$_,$usernum{$_}]} keys %usernum) { Wags ;) -Original Message- From: dan [mailto:[EMAIL PROTECTED]] Sent: Monday, July 22, 2002 17:55 To: [EMAIL PROTECTED] Subject: Re: sor

Re: Need some concept about package

2002-07-23 Thread drieux
On Friday, July 19, 2002, at 05:09 , Peter Scott wrote: [..] >> hence why the 'OO' style is so popular with the >> >> my $thing = FOO::BAR->new(@arglist); >> >> my $this = $thing->get_this($with_that); >> >> and the only 'exported' "method" is the 'new'... > > Please don't confuse

RE: Comparing Arrays

2002-07-23 Thread Bob Showalter
> -Original Message- > From: Timothy Johnson [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 23, 2002 11:41 AM > To: 'Bob Showalter '; ''Merritt Krakowitzer' '; 'Beginners ' > Subject: RE: Comparing Arrays > > > > In the "quick and dirty" category, you can do something like this: > >

RE: Comparing Arrays

2002-07-23 Thread Timothy Johnson
LOL yup. I knew someone would catch that. As Marvin would say, "Back to the old drawing board." -Original Message- From: Jeff 'japhy' Pinyan To: Timothy Johnson Cc: 'Bob Showalter '; ''Merritt Krakowitzer' '; 'Beginners ' Sent: 7/23/02 8:48 AM Subject: RE: Comparing Arrays On Jul 23,

RE: Comparing Arrays

2002-07-23 Thread Jeff 'japhy' Pinyan
On Jul 23, Timothy Johnson said: >In the "quick and dirty" category, you can do something like this: Too dirty. It says ('a', 'a', 'b') and ('a', 'b', 'b') are the same. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmo

Re: question about replacing ^M

2002-07-23 Thread Chas Owens
On Mon, 2002-07-22 at 19:15, David T-G wrote: > Desmond -- > > ...and then Desmond Lee said... > % > ... > % A sample from the file looks like this: > % > % while ( $row = $db->sql_fetchrow($result) );^M > % $db->sql_freeresult($result);^M^M $total_threads = > % count

RE: Comparing Arrays

2002-07-23 Thread Timothy Johnson
In the "quick and dirty" category, you can do something like this: (I'm trying to remember off the top of my head) ## my $result = ArrayCmp(\@array1,\@array2); #pass two array references sub ArrayCmp{ my($ref1,$ref2) = @_; my %tmp = (); if(@{$ref

Re: Can IPC work?

2002-07-23 Thread drieux
On Tuesday, July 23, 2002, at 12:14 , Mayank Ahuja wrote: [..] > Putting it graphically, > > > A > | > | > |--- > | | > | B > |(New Terminal) > |[User sets a variable] > | > | >(execution of the script continues

Re: Remove 4 last letters

2002-07-23 Thread Connie Chan
> > > $variable =~ s/\S\S\S\S$//; Heehee.. just for fun, what about if $variable = "123456\t8\t0" ? =) Rgds, Connie > > > John > -- > use Perl; > program > fulfillment > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To

Re: How to make @array2 use values of @array1?

2002-07-23 Thread chris
What I am after: changes to one forces changes to other but could not make work What I ended up with that works: @{$this->{"pkg_variable2"}} = @{$this->{"pkg_variable1"}} Sample listing of my problem follows. use PkgA; $pkga = "PkgA"; my $this = new $pkga; print @{$this->{"pkg_variable1"}}; # t

Re: Replace last # with \n

2002-07-23 Thread Jeff 'japhy' Pinyan
On Jul 23, John W. Krahn said: >Rich Busse wrote: >> >> I want to replace the last "#" with a newline. I've come up with a few ideas > >$_ = reverse; >s/#/\n/; >$_ = reverse; Here's a (potential) Perl 5.8.1 way of doing it, which is likely to be faster than the sexeger (reversing approach above)

Re: Replace last # with \n

2002-07-23 Thread John W. Krahn
Rich Busse wrote: > > I have a string that looks like > > Operator Overview#PGM#Report about all configured > operators#/opt/OV/bin/OpC/call_sqlplus.sh all_oper# > > I want to replace the last "#" with a newline. I've come up with a few ideas > like > > substr ($_, rindex ($_, "#"), 1) = "\n"

Re: Need help with package

2002-07-23 Thread drieux
On Monday, July 22, 2002, at 04:36 , chris wrote: > Here is what I am doing > > use A; > my $this = {}; > bless $this; > my $result = $this->A::sub1 (my $args); why pass in an uninitialized value??? that is scoped to pass out of existence also this blessed "object" gambit should be in the

Re: Remove 4 last letters

2002-07-23 Thread John W. Krahn
David Samuelsson wrote: > > This should be really simple, just use a regexp to remove > the 4 last letters from a variable. > > $variable =~ /\S\S\S\S$/; > print "$variable"; > > but this doesnt remove the 4 last letters when i run it, i > think i am just getting tired here and cant see why, wh

Curses-CursesWidgets-SCO Unix (why'd you think they call it curses?)

2002-07-23 Thread Doug Lentz
This may be a long shot, but I am trying to get Arthur Corliss's CursesWidgets 1.992 module to work on a SCO box. Must apologize first, I do not understand curses, no more than the average pig understands French. Server OS: SCO Open Server 5 (oxymoron, but we can't call it SCO Abandoned Server 5,

Re: Perl on-line books

2002-07-23 Thread Jim Agnew
I just found out that some sites have pirated books. I don't know if this is so or not, I've been told this is possibly a pirated copy. Sams still have it for sale, I think. Apologies, Jim Jim Agnew wrote: > > There's perl in 21 days... found it by using google. > > http://194.106.118.30/ft

FW: Replace last # with \n

2002-07-23 Thread Busse, Rich
Doh! I forgot about using $! All I need is s/#$/\n/ ; Thanks to Tor & Tanton for getting my brain in gear... > -Original Message- > From: Busse, Rich > Sent: Tuesday, 23 July, 2002 09:00 > To: 'Perl Beginners' > Subject: Replace last # with \n > > I have a string that l

Re: Replace last # with \n

2002-07-23 Thread Tanton Gibbs
if you want to use s/// you can say s/(.*)#/$1\n/; - Original Message - From: "Busse, Rich" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, July 23, 2002 9:00 AM Subject: Replace last # with \n > I have a string that looks like > > Operator Overview#PGM#Repor

Re: Replace last # with \n

2002-07-23 Thread Tor Hildrum
<[EMAIL PROTECTED]> wrote: > I have a string that looks like > > Operator Overview#PGM#Report about all configured > operators#/opt/OV/bin/OpC/call_sqlplus.sh all_oper# > > I want to replace the last "#" with a newline. I've come up with a few ideas > like > > substr ($_, rindex ($_, "#"), 1)

Replace last # with \n

2002-07-23 Thread Busse, Rich
I have a string that looks like Operator Overview#PGM#Report about all configured operators#/opt/OV/bin/OpC/call_sqlplus.sh all_oper# I want to replace the last "#" with a newline. I've come up with a few ideas like substr ($_, rindex ($_, "#"), 1) = "\n" ; or substr ($_, length ($_) - 1, 1) =

Re: Passing variable to sed command.

2002-07-23 Thread drieux
On Monday, July 22, 2002, at 02:38 , kent ho wrote: > Thanks, > > Kent I will admit that I pulled out my copy of the O'Reilly "Sed and Awk" - which I would recommend if you are going to be in that space long. Alternatively, you might look into perl open(IN, "$file") or "die unable to

RE: Comparing Arrays

2002-07-23 Thread Bob Showalter
> -Original Message- > From: Merritt Krakowitzer [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 23, 2002 3:48 AM > To: Beginners > Subject: Comparing Arrays > > > Hi > > I would like to know how to compare 2 arrays. > > I have 2 arrays and I would like to compare the contents of the

Re: regexp matching across newlines

2002-07-23 Thread David T-G
Bob, et al -- ...and then Bob Showalter said... % % > -Original Message- % > From: David T-G [mailto:[EMAIL PROTECTED]] ... % > Whoops! No it won't -- .* is greedy! % > % > You need something more like ... % > /(p1)[^(p2)]*(p2)/g ; ... % This does not match on input data like: % %

RE: Can IPC work?

2002-07-23 Thread Bob Showalter
> -Original Message- > From: Mayank Ahuja [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 23, 2002 3:15 AM > To: Perl > Subject: Can IPC work? > > > Hi All, > > Please go through the following scenario: > > A perl script has been invoked from shell A. Within the perl script, I > open

Re: Remove 4 last letters

2002-07-23 Thread Connie Chan
$var =~ s/.{4}$//; Rgds, Connie - Original Message - From: "David Samuelsson (PAC)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 23, 2002 8:00 PM Subject: Remove 4 last letters > This should be really simple, just use a regexp to remove the 4 last letters from a >v

RE: How to make @array2 use values of @array1?

2002-07-23 Thread Bob Showalter
> -Original Message- > From: nkuipers [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 23, 2002 2:13 AM > To: [EMAIL PROTECTED] > Subject: RE: How to make @array2 use values of @array1? > > > What I am about to raise, I do so more out of wanting someone > to educate me > than disagreei

Re: Remove 4 last letters

2002-07-23 Thread Sudarshan Raghavan
On Tue, 23 Jul 2002, David Samuelsson (PAC) wrote: > This should be really simple, just use a regexp to remove the 4 last letters from a >variable. > > $variable =~ /\S\S\S\S$/; This just checks if your patter \S... matches with the contents of $variable. This should be $variable =~ s/\S\S\S\S

Re: Remove 4 last letters

2002-07-23 Thread Chad Kellerman
Dave, I did it this way $variable = substr($orig_variable,0,length($orig_variable)-2); I actually only removed the last 2 characters but I don't see why you could not put a 4 and remove last four.. I am sort of new at perl but I did get the above to work. I needed to drop off 2 n

RE: regexp matching across newlines

2002-07-23 Thread Bob Showalter
> -Original Message- > From: David T-G [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 22, 2002 8:13 PM > To: perl beginners > Cc: David Newman > Subject: Re: regexp matching across newlines > > > David -- > > ...and then David Newman said... > % > % > Yes, but your *. should be .* to

Remove 4 last letters

2002-07-23 Thread David Samuelsson (PAC)
This should be really simple, just use a regexp to remove the 4 last letters from a variable. $variable =~ /\S\S\S\S$/; print "$variable"; but this doesnt remove the 4 last letters when i run it, i think i am just getting tired here and cant see why, what is the right way to do it? :) //Dave

RE: Interpreter

2002-07-23 Thread Marco Antonio Valenzuela Escárcega
tal vez te sirva leer esto: http://www.perl.com/pub/a/2001/06/13/recdecent.html es un tutorial de Parse::RecDescent, y como ejemplo se implementa un mini-lenguaje, y se sugieren algunas ideas acerca de que se le puede agregar. con suerte y este ejemplo es suficiente como base de tu proyecto. su

Re: How to make @array2 use values of @array1?

2002-07-23 Thread David T-G
Chris -- ...and then chris said... % % I have two variables (@array1 and @array2). @array1 will be % initialized with a list of values. Is it possible to declare @array2 % in such a way that it will reference @array1? Do you want @array2 to be a *copy* of @array1 when this is all done, or shoul

Re: Can IPC work?

2002-07-23 Thread David T-G
Mayank -- ...and then Mayank Ahuja said... % % Hi All, Hello! % % Please go through the following scenario: [snip] ... % % Is there a way by which Shell A can come to know of the value of the % variable set in B? % I don't know anything about IPC...can it work in this scenario? T

Re: Comparing Arrays

2002-07-23 Thread Janek Schleicher
Merritt Krakowitzer wrote at Tue, 23 Jul 2002 09:48:13 +0200: > I would like to know how to compare 2 arrays. > > I have 2 arrays and I would like to compare the contents of the data. It doesn't >matter in which > order the data is stored so long as its the same. So comparing the bellow should

Re: Comparing Arrays

2002-07-23 Thread John W. Krahn
Merritt Krakowitzer wrote: > > Hi Hello, > I would like to know how to compare 2 arrays. perldoc -q array Found in /usr/lib/perl5/5.6.0/pod/perlfaq4.pod [snip] How do I compute the difference of two arrays? How do I compute the intersection of two arrays? [snip] How do

Re: sorting %hash entries

2002-07-23 Thread John W. Krahn
Dan wrote: > > ok.. that worked, now how about if i wanted it to go the other way.. from > most to least? my @sorted = sort { $usernum{$b} <=> $usernum{$a} } keys %usernum; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: Comparing Arrays

2002-07-23 Thread Tor Hildrum
<[EMAIL PROTECTED]> wrote: > Hi > > I would like to know how to compare 2 arrays. > > I have 2 arrays and I would like to compare the contents of the data. > It doesn't matter in which order the data is stored so long as its the same. > So comparing the bellow should read true, but if they didn

Comparing Arrays

2002-07-23 Thread Merritt Krakowitzer
Hi I would like to know how to compare 2 arrays. I have 2 arrays and I would like to compare the contents of the data. It doesn't matter in which order the data is stored so long as its the same. So comparing the bellow should read true, but if they didn't match it would be false. my @foo = qw(

Re: Position 251 ???

2002-07-23 Thread Konrad Foerstner
Okay, know I tried it and it works perfectly! Thanks! On Mon, 22 Jul 2002 15:37:03 -0400 Bob Showalter <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: Konrad Foerstner [mailto:[EMAIL PROTECTED]] > > Sent: Monday, July 22, 2002 2:19 PM > > To: [EMAIL PROTECTED] > > Subject