AppConfig module ...need help.

2002-01-31 Thread jeff loetel
Howdy, I'm trying to run the AppConfig module, but making a error somewhere, it should be straight forward but At any rate here is the code, followed by the config file followed by the error. #code #!/usr/bin/perl use AppConfig; my $file = "/var/tmp/config.txt"; my $config = AppConfig->ne

RE: perl database access

2002-01-31 Thread Keith A. Calaman
http://www.perldoc.com/perl5.6.1/lib/DBI.html -Original Message- From: Jefferson Ryan Lee [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 8:52 PM To: [EMAIL PROTECTED] Subject: perl database access Hi, Are there any way to access a database (SQL Server) not using th

Moving CGI 'param' data into a writable hash [was:: What's wrong with this?]

2002-01-31 Thread Gary Hawkins
> using the Perl4 cgi-lib.pl. However, I can think of no other > legitimate use. Here's a nice, > clean method of dealing with this: > > use strict; > use CGI qw/:standard/; > my %form_data = map { $_, get_data($_) } param; > > sub get_data > { > my $name = shift; >

Re: pulling file name into perl (fwd)

2002-01-31 Thread Deen Hameed
eep! I am referring to the system() call there... :) -- Forwarded message -- Date: Fri, 1 Feb 2002 09:09:50 +0530 (IST) From: Deen Hameed <[EMAIL PROTECTED]> To: Russell Boyd <[EMAIL PROTECTED]> Cc: "<" <[EMAIL PROTECTED]> Subject: Re: pulling file name into perl Hi Russell, I

Re: pulling file name into perl

2002-01-31 Thread Deen Hameed
Hi Russell, It executes a command and returns the EXIT STATUS of the command. If you look in $date, you will find the exit status of "ls ..." as returned by the wait() call. deen On Thu, 31 Jan 2002, Russell Boyd wrote: > I am wanting to get a unix directory file listing and put it into a P

RE: test

2002-01-31 Thread Timothy Johnson
That was uneventful. -Original Message- From: Eric [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 9:49 PM To: [EMAIL PROTECTED] Subject: test -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --

Re:[ot] Please point me to a language (perl I hope)

2002-01-31 Thread maureen
Try setting the background image in a frame with the background attribute of the HTML body tag: Your content here Where you change "myImage.jpg" to whatever your image is named. You can insert the animated gif through the tag. hth, Maureen Luinrandir Hernson wrote: > > Sorry if this is

test

2002-01-31 Thread Eric
.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Please point me to a language (perl I hope)

2002-01-31 Thread Luinrandir Hernson
Sorry if this is off topic, but I really don't know who else to ask. Heres what I want to do.. maybe you would be so kind as to tell me what language this can best be done in. I'm just learning perl and know HTML. within frames (or a table)... I would like to put a large gif in the backround an

perl database access

2002-01-31 Thread Jefferson Ryan Lee
Hi, Are there any way to access a database (SQL Server) not using the ODBC? It is possible for a perl script to query a database not on a local machine instead on a different location through tcp-ip/internet? Please advise. Thanks. Regards, Jeff -- To unsubscribe, e-mail: [EMAIL

Problem with format command

2002-01-31 Thread Michael Eggleton
Hello All, Here is the code for the format command: use Win32::Service; push( @ARGV, Win32::NodeName() ) unless( scalar @ARGV ); foreach my $Machine ( @ARGV ) { local %List; print "Available services on $Machine:\n"; if( Win32::Service::GetServices( $Machine, \%List ) ) {

RE: return # of minutes since 5:00pm Jan 18, 2002 in perl on linux box

2002-01-31 Thread Wagner-David
From windows, but just using std Perl functions: use Time::Local; my $MyKnownDate = timelocal(0,0,17,18,0,102); printf "%-s\n", scalar(localtime($MyKnownDate));# just reprinting so you know we are using the

return # of minutes since 5:00pm Jan 18, 2002 in perl on linux box

2002-01-31 Thread KeN ClarK
subject fairly sums it up. If I use localtime to get what time it is right now how can I determine the number of minutes between a KNOWN moment, such as above, and say, at the time the script is run? So far I have nothing and am perplexed... _ http://quanti

Re: [ma-linux] Just when you thought you are done, the - is there- appears

2002-01-31 Thread Geoff Silver
> The only problem is that WEB server has been configured to allows access to > this > site based on a range of IP address. If a new organization subscribes to > this site > (flat fee, unlimited access only), their IP range is made known to the web > server (the Sys Admin's job). > > So my initia

Win32::GUI Richedit Question

2002-01-31 Thread Agustin Rivera
Any one have some GOOD (maybe GREAT) documentation or links for Win32 GUI? Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Access Transmitted Data On "Server" Side Of A TCP Socket

2002-01-31 Thread Hewlett Pickens
I apologize for the multiple posts. The post with attachments was "rejected" once by the list with "Your mail to murzc could not be delivered because murzc is not accepting mail with attachments or embedded images" so I sent it a second time with the code snippets included in the post. Don't kno

RE: Dates in file or directory names ?

2002-01-31 Thread Wagner-David
Title: Blank     use somehting like: my ($mday, $mon, $year) = (localtime(time))[3..5];    # pull day,month, year only$year += 1900; # want 4 digit date$mon++;   # need

Grab IP and send email notification

2002-01-31 Thread Richard Balfour
I'm looking for a way to grab just the IP address from an ifconfig command then send that variable out to an email address via a sendmail process. Does anyone have any ideas how to write this little script? Thanks, Richard -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Dates in file or directory names ?

2002-01-31 Thread Mark Richmond
Title: Blank Ok, so I'm confused   What I want to do is create a directory where the name is the current date say mkdir(2002131);  What Can't figure out is how to build the date string. I'm sure I'm just missing something. Any thoughts.       -regards     -mark - Mark Richmond <[EMAIL PR

Re: [ma-linux] Just when you thought you are done, the - is there- appears

2002-01-31 Thread Jacob Rose
William, It sounds like you've found a solution that you like in querying ARIN; what are you asking for help with? Jacob On Thu, 31 Jan 2002 [EMAIL PROTECTED] wrote: > Hello, > > Is there a better way to solve this? > > > PROBLEM: > > I have set up a web site for a government big contractor, i

RE: More Economic Use of Hash

2002-01-31 Thread Balint, Jess
Thanks. Works great. Any ideas how I might sort the output hash for output to a file in key order? -Original Message- From: Roger C Haslock [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 2:23 PM To: Balint, Jess; [EMAIL PROTECTED] Subject: Re: More Economic Use of Hash # Wh

pop-up box JOIN() to mysql not populating dates

2002-01-31 Thread Keith A. Calaman
I have pasted my code below. The problem I am having is: my $ndate = join('-', $nyear,$nmonth,$nday); is printing back to my form the exact format that should be correct to insert into mysql. However, when the INSERT runs the value does not get inserted properly. $nyear,$nmonth,$nday are grab

Re: [ma-linux] Just when you thought you are done, the - is there - appears

2002-01-31 Thread William.Ampeh
Well, my boss wants to find out if there is a BETTER solution. I do not want to say NO right away, so I figured why not as around? He might be right. There may be an alternative solution. Personally, I wish there is not. Because I have had it with this project. __ William Am

RE: replacing multiple blank lines with a single blank line

2002-01-31 Thread Jeff 'japhy' Pinyan
On Jan 31, Nikola Janceski said: >you want to treat $text as a single string >use >$text =~ s/\n+/\n/sg; # use /mg if you want to treat the string as multiple >lines. Your information about /s and /m is wrong. /s changes how . matches, and there is no . in your regex. /m changes how ^ and $ w

Re: Launch a url in my web browser?

2002-01-31 Thread John
In NT you can use the start command with a URL. So to start a brower at a specific location: system( "start http://jpw3.com/search.html"; ); Depending on how you have IE configured, this might start a new window. If it doesn't and you need to use a new browser window: system( "start iexplor

RE: Regex help Please...

2002-01-31 Thread Nikola Janceski
better...(assuming the filename would never have a stupid / in it) ($drive, $path, $file) = ($fullpath =~ m~(\w:)/(.*?)([^/]+)$~); would output: C: TopDir/outer/inner/ file.fl -Original Message- From: Curtis Poe [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:39 PM To: [

Re: Regex help Please...

2002-01-31 Thread Curtis Poe
--- [EMAIL PROTECTED] wrote: > I know this is not a good RegEx. Can I see some criticism and fine-tuning of > this RegEx that I came up with? > > Objective: To parse the path to drive, directory and file name. > > Here is what I came up with. > > # > $fullpath =

Re: Launch a url in my web browser?

2002-01-31 Thread Alan C.
Hi, My oversight, I forgot to say that this would be on my own local machine a Win 2k box Since I am sometimes in a text editor that has ability to launch a perl file then: the handyness to get a url launched by using a perl script to do so Thanks. Alan. At 06:41 AM 1/31/2002 -0800, you wro

RE: What's wrong with this?

2002-01-31 Thread Gary Hawkins
> >Fields are all unique. > > Fields are not all unique. > >Chocolate >Vanilla >Strawberry I'm sorry Jeff, I meant that in this case, with this script and set of web pages, the fields are all unique. For real new beginners, note also another relatively common way that field names can

RE: pulling file name into perl

2002-01-31 Thread Hanson, Robert
Use backticks, not system(). $date = `ls -al | grep filename.txt`; Or if you want it in an array like you mentioned, do this... @date = `ls -al | grep filename.txt`; Rob -Original Message- From: Russell Boyd [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:17 PM To: < Su

Re: Regex help Please...

2002-01-31 Thread John
Couldn't it be: m#^([^\\/]+)(.*)([^\\/]+)$# ) At Thursday, 31 January 2002, [EMAIL PROTECTED] wrote: >I know this is not a good RegEx. Can I see some criticism and fine- tuning of >this RegEx that I came up with? > >Objective: To parse the path to drive, directory and file name. > >Here is wha

pulling file name into perl

2002-01-31 Thread Russell Boyd
I am wanting to get a unix directory file listing and put it into a Perl array. I attempted $date = system "ls -al | grep filename.txt"; However all this did was send it to . What am I missing? Thanks, Russell -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Regex help Please...

2002-01-31 Thread RArul
I know this is not a good RegEx. Can I see some criticism and fine-tuning of this RegEx that I came up with? Objective: To parse the path to drive, directory and file name. Here is what I came up with. # $fullpath = "C:/TopDir/outer/inner/file.fl"; ($drive, $pat

Just when you thought you are done, the - is there - appears

2002-01-31 Thread William.Ampeh
Hello, Is there a better way to solve this? PROBLEM: I have set up a web site for a government big contractor, it currently works fine. The only problem is that WEB server has been configured to allows access to this site based on a range of IP address. If a new organization subscribes to th

Re: Access Transmitted Data On "Server" Side Of A TCP Socket

2002-01-31 Thread Dave Benware
Hewlett Pickens wrote: > > Using O'Reilly's "Learning Perl", have set up a "bare bones" socket > connection between two computers to send a small amount of data from the > "client" to the "server". (For learning, not for the real world.) > > The client sends "are you there" and the server res

RE: Access Transmitted Data Received On "Server" Side Of A TCP Socket

2002-01-31 Thread MECKLIN, JOE (ASI)
Hew, I've never delved into this area at all, but looking at your code, shouldn't you have Proto=> "tcp", in the IO:::Socket... on server as well as client? Joe -Original Message- From: Hewlett Pickens [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 12:50 PM To: [EMAIL

Re: More Economic Use of Hash

2002-01-31 Thread Roger C Haslock
# Why not ... while( ) { @tmp = split( /\|/ ); if (exists $freq{$tmp[$table]}) { $freq{$tmp[$table]}++ } else { $freq{$tmp[$table]}=1 } $tot ++ } - Original Message - From: "Balint, Jess" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Th

Access Transmitted Data Received On "Server" Side Of A TCP Socket

2002-01-31 Thread Hewlett Pickens
Using O'Reilly's "Learning Perl", have set up a "bare bones" socket connection between two computers to send a small amount of data from the "client" to the "server". (For learning, not for the real world.) The client sends "are you there" and the server responds with "I am here, what do you wan

Access Transmitted Data Received On "Server" Side Of A TCP Socket

2002-01-31 Thread Hewlett Pickens
Using O'Reilly's "Learning Perl", have set up a "bare bones" socket connection between two computers to send a small amount of data from the "client" to the "server". (For learning, not for the real world.) The client sends "are you there" and the server responds with "I am here, what do you wan

RE: How to export environment variables in Win32

2002-01-31 Thread Timothy Johnson
Download the Win32::AdminMisc module from http://www.roth.net/perl. The SetEnvVar() function will do what you want. Keep in mind that while new windows will have the new environment variables, the environment the script is running uner will still have to be set manually using the %ENV hash or t

Re: system "dir"; works fine, but system "dir foo.txt" gets anerror

2002-01-31 Thread Peter Scott
At 11:55 AM 1/31/02 -0500, Dave Benware wrote: > > Nope. It just thinks that the name of the command you're running is "dir > > foo.txt". Separate the arguments explicitly, e.g.,: > > > > C:\WINDOWS>perl -e "system qw(dir mouse.txt)" > >Yah, that works fine, tho I don't understand why. Is there

More Economic Use of Hash

2002-01-31 Thread Balint, Jess
I am attemping to create a frequency chart based on a pipe delimited database output. Following is what I have come up with. The hash create from this is then output to another file. It seems to be very slow on files in excess of ~1 lines. This will be used on ~50 line files and needs to b

Access Transmitted Data On "Server" Side Of A TCP Socket

2002-01-31 Thread Hewlett Pickens
Using O'Reilly's "Learning Perl", have set up a "bare bones" socket connection between two computers to send a small amount of data from the "client" to the "server". (For learning, not for the real world.) The client sends "are you there" and the server responds with "I am here, what do you wan

Re: How to export environment variables in Win32

2002-01-31 Thread Pozsar Balazs
It is neither possible in unix. When you run a batch script under Win32, or 'source' a shell script under unix, you only have 1 process, and that process is executing commands, which set _its_ env variables. If your fork a child process (ie. start perl to execute the perl-script), it can only ch

About a linking folder

2002-01-31 Thread Jose Vicente
I am trying to access a folder, but this folder is linking rapidly, I need your help. Can anybady explain me why does ithappens.

Re: replacing multiple blank lines with a single blank line

2002-01-31 Thread Curtis Poe
--- "Moore, Larry" <[EMAIL PROTECTED]> wrote: > I want to slurp a file and make multiple blank lines into single blank > lines. Here is my code: > > #! perl -w > use strict; > > my $file = "test.fmt"; > > open (IN, $file) or die; > open (OUT, ">>test.txt"); > > my $text; > > { > local

RE: Writing to a file

2002-01-31 Thread Bill Akins
For others who may want to see how module works... Here is a snippet of code I used with the Write:Excel module... Was written and run on WinNT without Excel installed on the box. It reads in csv files into Excel file and then sets some limited formatting (freeze panes and set column widths).

How to export environment variables in Win32

2002-01-31 Thread Adriano Rodrigues Ferreira
I thought it would be a good idea to replace a batch script (.bat) running on a Windows 2000 with a Perl script which is far more clever. The original batch file setted two environment variables which were available after running the script. That is, if I did c:> cvs-init.bat it has commands l

RE: join

2002-01-31 Thread Deen Hameed
is this scary or what? LOL :) On Thu, 31 Jan 2002, Deen Hameed wrote: > > the ? is a special character within a regular expression (which is what > the two /s inside split contain). If you want to split on the ?, you'll > have to escape it, like \? > > Have a look at perldoc perlre for what re

RE: replacing multiple blank lines with a single blank line

2002-01-31 Thread Nikola Janceski
you want to treat $text as a single string use $text =~ s/\n+/\n/sg; # use /mg if you want to treat the string as multiple lines. -Original Message- From: Moore, Larry [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 12:33 PM To: beginners@perl. org (E-mail) Subject: replacing

replacing multiple blank lines with a single blank line

2002-01-31 Thread Moore, Larry
I want to slurp a file and make multiple blank lines into single blank lines. Here is my code: #! perl -w use strict; my $file = "test.fmt"; open (IN, $file) or die; open (OUT, ">>test.txt"); my $text; { local $/; $text = ; close IN; } # $text =~ s/\0{2,}/\0\0/mg; # this removes

Re: Debug some simple code

2002-01-31 Thread Rambog
Thank you all for you prompt and accurate help. I will not soon forget the difference between assigning a value and a numeric comparison operator. Jason, with the "@a=$number" statement, I was trying to create the list by changing contexts. In other words, if returns the input in a scaler cont

Re: join

2002-01-31 Thread Deen Hameed
the ? is a special character within a regular expression (which is what the two /s inside split contain). If you want to split on the ?, you'll have to escape it, like \? Have a look at perldoc perlre for what regular expressions are about. deen On Thu, 31 Jan 2002, Darren Simpson wrote: > hi

RE: Writing to a file

2002-01-31 Thread MECKLIN, JOE (ASI)
I have used Spreadsheet::WriteExcel and it works without a hitch for me, though I just do barebones cell creation on a single worksheet, nothing fancy at all. Still, no one has complained at all about the end result not being usable. -Original Message- From: Timothy Johnson [mailto:[EM

Re: system "dir"; works fine, but system "dir foo.txt" gets anerror

2002-01-31 Thread Dave Benware
Peter Scott wrote: > > At 11:35 AM 1/31/02 -0500, Dave Benware wrote: > >The line system "dir foo.txt"; returned "Bad command or file name". > > > >foo.txt does exist and I can run dir foo.txt within a dos box just > >fine. Interestingly to me, system "dir"; worked okay. I guess it > >just wo

Re: it is bad?

2002-01-31 Thread Jonathan E. Paton
| sub add_module | { | my($tempposition,$name,@variables) = @_; | my $mdl_output; | do "$name.mdl"; | if ($mdl_output=&ModulAdd(@variables)) | { | $html_write{$tempposition}="$html_write{$tempposition}$mdl_output"; | } | undef &ModulAdd; | my $length=length($mdl_output); | } Indentation

Re: system "dir"; works fine, but system "dir foo.txt" gets an error

2002-01-31 Thread Peter Scott
At 11:35 AM 1/31/02 -0500, Dave Benware wrote: >The line system "dir foo.txt"; returned "Bad command or file name". > >foo.txt does exist and I can run dir foo.txt within a dos box just >fine. Interestingly to me, system "dir"; worked okay. I guess it >just won't take an argument. > >So, have I

RE: Writing to a file

2002-01-31 Thread Timothy Johnson
Supposedly there's a module out there called Spreadsheet::WriteExcel, but I haven't tried it yet. That might also be worth a look. -Original Message- From: Lance Prais To: John Edwards; PERL Sent: 1/31/02 9:57 AM Subject: RE: Writing to a file I am working on a Solaris box. So I will

Re: Debug some simple code

2002-01-31 Thread Jeff 'japhy' Pinyan
On Jan 31, Rambog said: >I am attempting a program that reads a list of numbers from the screen until >the number 999 is read. It then prints the sum of all numbers read- with >the exception of the 999. > >My code looks like: > >until ($number=999) { You want ==, not = here. >print "Please inp

RE: Debug some simple code

2002-01-31 Thread John Edwards
Change until ($number=999) { and if ($number=999) { to == 999. You are assigning the value 999 to the $number var in both cases, not checking if it is equal to 999. Simple mistake, we've all made it ;) HTH John P.S Here is how I would code this script. use strict; my ($number, $total);

system "dir"; works fine, but system "dir foo.txt" gets an error

2002-01-31 Thread Dave Benware
Running the script (below) from Bob Showalter brought a problem to surface on this win98se using ActivePerl 560 build 630. The line system "dir foo.txt"; returned "Bad command or file name". foo.txt does exist and I can run dir foo.txt within a dos box just fine. Interestingly to me, system

RE: Debug some simple code

2002-01-31 Thread Hanson, Robert
You are using the assignment operator in your "until" and "if" blocks, and *not* the comparison operator. You need to use the double equals for what you want... until ($number == 999) And if ($number == 999) Rob -Original Message- From: Rambog [mailto:[EMAIL PROTECTED]] Sent: Thursd

Re: Debug some simple code

2002-01-31 Thread Roger Morris
At 11:09 AM 1/31/2002 -0500, you wrote: >I am attempting a program that reads a list of numbers from the screen until >the number 999 is read. It then prints the sum of all numbers read- with >the exception of the 999. > >My code looks like: > >until ($number=999) { >print "Please input your numb

Re: Debug some simple code

2002-01-31 Thread Jason Purdy
A couple of things here ... 1) Watch out for = vs. == ... very tricky! Your first until loop won't even eval b/c $number=999 is always true. 2) @a=$number; is not what you want... I'm not even sure what that does. You probably want to use the push function, like so: push @a, $number

Re: Writing to a file

2002-01-31 Thread Bill Akins
There is a great article you can read about using Spreadsheet::WriteExcel and Spreadsheet::ParseExcel modules. It can be found here: http://www-106.ibm.com/developerworks/linux/library/l-pexcel/ HTH! >>> "Lance Prais" <[EMAIL PROTECTED]> 01/31/02 12:45PM >>> I have a question regarding writing

Re: What's wrong with this?

2002-01-31 Thread Curtis Poe
--- Jan Gruber <[EMAIL PROTECTED]> wrote: > Hi ! > > Sorry for the previous posting, im not yet completely awake ;o) > > > > >How can the param's be placed into a new hash? > > > > > > CGI.pm has a Vars() method, I believe, which returns a hash. > > > > > > use CGI; > > > my $q = CGI->new;

Re: join

2002-01-31 Thread Jason Purdy
Oops - split cannot take "?" as its first parameter - I apologize ... go w/ the /\?/ approach. :) Jason If memory serves me right, on Thursday 31 January 2002 11:15, Jason Purdy wrote: > The //'s around the ? treat the first paramater of the split() function as > a regular expression, which tr

Debug some simple code

2002-01-31 Thread Rambog
I am attempting a program that reads a list of numbers from the screen until the number 999 is read. It then prints the sum of all numbers read- with the exception of the 999. My code looks like: until ($number=999) { print "Please input your number:\n"; chomp($number=); @a=$number; } foreach $

Re: join

2002-01-31 Thread Jason Purdy
The //'s around the ? treat the first paramater of the split() function as a regular expression, which treats the question mark as a special character (saying to match the preceding char(s) zero or one time). If you're trying to split $testdata with an actual question mark, try using quotes in

RE: join

2002-01-31 Thread Nikola Janceski
? is a special charater (a quantifier like * or {6} ) it quantifies to 0 or 1; it's also a modifier to a quantifier causing it to match the least of the quantifier. Just put a \ in front of it split(/\?/,$testdata); -Original Message- From: Darren Simpson [mailto:[EMAIL PROTECTED]] Sen

Re: What is the newline character (\n) equal to?

2002-01-31 Thread Dave Benware
> So you can see that the string is 4 bytes long. When I write it to the file, > the file becomes 5 bytes, because the LF is converted to a CR/LF pair. When > I read it back in, the reverse conversion is made, so the string becomes 4 > bytes again. When I call binmode, that conversion is not

RE: join

2002-01-31 Thread Hanson, Robert
The question mark is a special character in a regular expression meaning "zero or one" and *must* follow a character or character class. If you want to split on the question mark character you need to escape it so that it no longer has special meaning. Like this: split(/\?/,$testdata); Rob --

RE: What is the newline character (\n) equal to?

2002-01-31 Thread Dennis G. Wicks
I got the same results using ActiveState on NT 4.0 but cyqwin gives me: length is 4 -rw-r--r--1 dennis None5 Jan 31 10:02 foo.txt length is 5 length is 5 I will leave the analysis to someone more qualified than I! Good Luck! Dennis -- To unsu

RE: Printing Ordered Hash Values

2002-01-31 Thread RArul
> > Reversing the hash is more work than it's worth, as you've found out. Certainly true and here is my mea culpa :))- It just did not occur to me about the, @keys = sort { $hash{$b} <=> $hash{$a} } keys %hash; statement. Thanks Japhy and Nikola. - Rex

join

2002-01-31 Thread Darren Simpson
hi. i keep getting wierd errors when i try to split a string. the string is split(/?/,$testdata); the error i get is /?/: ?+* follows nothing in regexp what does it mean Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Printing Ordered Hash Values

2002-01-31 Thread Jeff 'japhy' Pinyan
On Jan 31, [EMAIL PROTECTED] said: >I have a simple hash with directory names as keys and sizes as values. I >would like to print the hash, in descending order of the size of each >directory. # this sorts your keys based on their values, descending @keys = sort { $hash{$b} <=> $hash{$a} } ke

RE: Writing to a file

2002-01-31 Thread Lance Prais
I am working on a Solaris box. So I will try the winExcel, hopefully that will solve this. Thank You Lance -Original Message- From: John Edwards [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 7:50 AM To: 'Lance Prais'; PERL Subject: RE: Writing to a file What OS are you

RE: Writing to a file

2002-01-31 Thread John Edwards
What OS are you running? I've included a script that uses Win32::OLE to interface with Excel. You'll need to be on a Win32 machine, with Excel installed. There is also a module called Spreadsheet::WriteExcel which is platform independant, but I have not had any experience using this. HTH John

RE: text to html converter

2002-01-31 Thread Nikola Janceski
You can also use Nedit www.nedit.org if your not a big emacs fan. -Original Message- From: Gary [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 10:47 AM To: Booher Timothy B 1stLt AFRL/MNAC Cc: [EMAIL PROTECTED] Subject: Re: text to html converter I am going to break one of

Printing Ordered Hash Values

2002-01-31 Thread RArul
I have a simple hash with directory names as keys and sizes as values. I would like to print the hash, in descending order of the size of each directory. I was contemplating of "reversing" the hash(so that sizes become keys and directory names become values) and then do a sort on the keys. Howeve

using su with ssh module

2002-01-31 Thread Justin Hansen
Hi, I am trying to write a perl5 script on Redhat that will use the ssh module and pass various commands to various servers. I am trying to run multiple commands using ssh2 and run commands as root. I am unable to log in directly as root and need to use the "su -" command. However, I reciev

Writing to a file

2002-01-31 Thread Lance Prais
I have a question regarding writing to a file. I have written a script and my experiences in perl thus far has been limited to outputting data to a JSP page but in this case I need to send it to a excel file. Does anyone know if there are examples out there that can show me how to do this? Than

Re: text to html converter

2002-01-31 Thread Gary
I am going to break one of my rules and suggest a non-perl solution. There probably is a way to do this in perl however if I understand your requirement correctly you can use a good text editor instead. There are text editors out there that do syntax highlighting -- they will make comments, rese

RE: html entity conversion... one liner?

2002-01-31 Thread Bob Showalter
> -Original Message- > From: KAVANAGH, Michael [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 9:06 AM > To: '[EMAIL PROTECTED]' > Subject: html entity conversion... one liner? > > > I thought it would be good to be able to do this: > > $item = ""; > $item =~ tr/<>/(<)(>)

text to html converter

2002-01-31 Thread Booher Timothy B 1stLt AFRL/MNAC
Hello - when printing out a lot of my c++ code I go from a nice color syntaxed environment to a plain old black and white. If there isn't already something else out there I would like to write a Perl script that changes all comments to green for example and preserves the tab spacing into the htm

RE: html entity conversion... one liner?

2002-01-31 Thread Chas Owens
On Thu, 2002-01-31 at 09:39, John Edwards wrote: > Why *must* it be a one liner. I think my suggestion is easier to understand > for someone having to maintain your code. If there is no other reason than > "I want a one liner" to do this on one line, then why not do it on two?? > Just because it i

RE: What's wrong with this?

2002-01-31 Thread Jeff 'japhy' Pinyan
On Jan 31, Gary Hawkins said: >> >> for $field (param()) { >> >> print "$field => ", param($field), "\n"; >> >> } >> > >> >How can the param's be placed into a new hash? >> >> CGI.pm has a Vars() method, I believe, which returns a hash. >> >> use CGI; >> my $q = CGI->new; >> $data =

Re: html entity conversion... one liner?

2002-01-31 Thread John W. Krahn
Michael Kavanagh wrote: > > I thought it would be good to be able to do this: > > $item = ""; > $item =~ tr/<>/(<)(>)/; tr/// will translate the '<' to a '(' and the '>' to a '&'. > to convert those <> symbols to their entity references. > however, the tr operator doesn't seem to like using (

RE: html entity conversion... one liner?

2002-01-31 Thread John Edwards
Why *must* it be a one liner. I think my suggestion is easier to understand for someone having to maintain your code. If there is no other reason than "I want a one liner" to do this on one line, then why not do it on two?? Just because it is possible in one line, doesn't mean it's the best approa

Re: Launch a url in my web browser?

2002-01-31 Thread Ahmed Moustafa
I believe that is not possible. A server side script can't launch a client's browser. Alan C. wrote: > Hi, > > Win 2k with MSIE web browser > > Whether or not my web browser is already been launched/opened > > Can a Perl script do that task? Or a perl module? > > Able to do without bringin

RE: Modifying/Additng text in a file

2002-01-31 Thread John Edwards
If the file is fixed in this format, then you could do a check for ) and write the line after that is found. Then continue with the file. For example open IN, "c:/input.txt" || die "Can't open c:/input.txt: $!"; open OUT, ">c:/new.txt" || die "Can't create c:/new.txt: $!"; while () {

Re: html entity conversion... one liner?

2002-01-31 Thread Briac Pilpré
On Thu, 31 Jan 2002 14:06:06 -, Michael Kavanagh <[EMAIL PROTECTED]> wrote: > I thought it would be good to be able to do this: > > $item = ""; > $item =~ tr/<>/(<)(>)/; > > to convert those <> symbols to their entity references. however, the > tr operator doesn't seem to like using () to g

Re: html entity conversion... one liner?

2002-01-31 Thread Chas Owens
On Thu, 2002-01-31 at 09:06, KAVANAGH, Michael wrote: > I thought it would be good to be able to do this: > > $item = ""; > $item =~ tr/<>/(<)(>)/; > > to convert those <> symbols to their entity references. > however, the tr operator doesn't seem to like using () to group... any > comments on

Modifying/Additng text in a file

2002-01-31 Thread pn
I have a file whose contents are of the form : NET_A OUTPUT ( REQUIRED ( _UP %0.093 BR CLK _DN %0.093 BR CLK ) ) NET_B OUTPUT ( REQUIRED ( _UP %0.093 BR CLK _DN %0.093 BR CLK ) ) I would like to read in this file in and modify the contents to be as follows :

RE: html entity conversion... one liner?

2002-01-31 Thread John Edwards
$item =~ s//>/g; Well. It is on one line ;) John -Original Message- From: KAVANAGH, Michael [mailto:[EMAIL PROTECTED]] Sent: 31 January 2002 14:06 To: '[EMAIL PROTECTED]' Subject: html entity conversion... one liner? I thought it would be good to be able to do this: $item = ""; $ite

RE: What is the newline character (\n) equal to?

2002-01-31 Thread Bob Showalter
> -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 9:02 AM > To: 'Dave Benware'; Beginners perl > Subject: RE: What is the newline character (\n) equal to? > > > > -Original Message- > > From: Dave Benware [mailto:[EMAIL PROTE

html entity conversion... one liner?

2002-01-31 Thread KAVANAGH, Michael
I thought it would be good to be able to do this: $item = ""; $item =~ tr/<>/(<)(>)/; to convert those <> symbols to their entity references. however, the tr operator doesn't seem to like using () to group... any comments on how to make this operation in to a one-liner? Thanks Mike -- To u

RE: What is the newline character (\n) equal to?

2002-01-31 Thread Bob Showalter
> -Original Message- > From: Dave Benware [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 8:51 AM > To: Beginners perl > Subject: Re: What is the newline character (\n) equal to? > > > Dave Benware wrote: > > CR/LF has never been translated to a LF while reading a file > >

Re: What is the newline character (\n) equal to?

2002-01-31 Thread Chas Owens
ISSUES Newlines In most operating systems, lines in files are terminated by newlines. Just what is used as a newline may vary from OS to OS. Unix traditionally uses `\012', one type of DOSish I/O uses `\015\012', and Mac OS uses `\015'. Perl uses `\n' to represent the "logical" newline, where

Re: What is the newline character (\n) equal to?

2002-01-31 Thread Dave Benware
Dave Benware wrote: > CR/LF has never been translated to a LF while reading a file > for me. If that were true, the whole situation would be > transparent and I would have never asked the question it seems. > I didn't see anything about this "translating" in the docs > on the binmode function. >

  1   2   >