Re: I don't know where to start with this one.

2007-01-30 Thread Kenton Brede
On 1/30/07, Randal L. Schwartz merlyn@stonehenge.com wrote: Kenton == Kenton Brede [EMAIL PROTECTED] writes: Kenton [EMAIL PROTECTED] [EMAIL PROTECTED] Kenton [EMAIL PROTECTED] [EMAIL PROTECTED] Kenton [EMAIL PROTECTED] [EMAIL PROTECTED] Kenton [EMAIL PROTECTED] [EMAIL PROTECTED] Kenton [EMAIL

I don't know where to start with this one.

2007-01-29 Thread Kenton Brede
I need some advice as to how to approach this problem. I've got a mail alias file, space delimited and sorted on the second column like: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL

Re: I don't know where to start with this one.

2007-01-29 Thread Kenton Brede
On 1/29/07, John W. Krahn [EMAIL PROTECTED] wrote: Kenton Brede wrote: I need some advice as to how to approach this problem. I've got a mail alias file, space delimited and sorted on the second column like: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL

scalar in array name?

2006-10-06 Thread Kenton Brede
I've done some searching and can't find an answer to this. I'd like to use a scalar variable in an array name. Something like @$scalar I've tried different permutations like [EMAIL PROTECTED], @$scalar @\$scalar and none of them work. What I'm trying to do is come up with a way to slurp ARGV

Re: chown-ing symlink

2004-03-15 Thread Kenton Brede
On Mon, Mar 15, 2004 at 12:57:08PM -0800, John W. Krahn ([EMAIL PROTECTED]) wrote: Wiggins D'Anconia wrote: What is the OP really doing? Why the need to change the ownership of a link, and why wasn't it created with the correct ownership to begin with? The ownership on a symlink should

Re: Exit

2004-03-03 Thread Kenton Brede
On Wed, Mar 03, 2004 at 06:17:36PM -, Rob Dixon ([EMAIL PROTECTED]) wrote: I hope, and think, that I've helped several people to be more eloquent in Perl. The language fascinates me in the way that nearly all who can speak can use it: thanks to Larry, who knew before we did what a

Re: Pattern matching problem

2004-02-25 Thread Kenton Brede
On Wed, Feb 25, 2004 at 04:35:57PM +, Henry Todd ([EMAIL PROTECTED]) wrote: I'm having trouble counting the number of specific substrings within a string. I'm working on a bioinformatics coursework at the moment, so my string looks like this: If you don't get an answer to your question

Re: Pattern matching problem

2004-02-25 Thread Kenton Brede
On Wed, Feb 25, 2004 at 05:52:19PM -, Rob Dixon ([EMAIL PROTECTED]) wrote: Kenton Brede wrote: I'm having trouble counting the number of specific substrings within a string. I'm working on a bioinformatics coursework at the moment, so my string looks like this: If you don't get

Re: Pattern matching problem

2004-02-25 Thread Kenton Brede
On Wed, Feb 25, 2004 at 06:30:55PM -, Rob Dixon ([EMAIL PROTECTED]) wrote: Kenton Brede wrote: On Wed, Feb 25, 2004 at 05:52:19PM -, Rob Dixon ([EMAIL PROTECTED]) wrote: Kenton Brede wrote: I'm having trouble counting the number of specific substrings within a string

Re: Pattern matching problem

2004-02-25 Thread Kenton Brede
On Wed, Feb 25, 2004 at 06:12:55PM +, Henry Todd ([EMAIL PROTECTED]) wrote: On 2004-02-25 17:42:46 +, [EMAIL PROTECTED] (Kenton Brede) said: If you don't get an answer to your question this is probably why - http://learn.perl.org/beginners-faq#2.2%20%20what%20is%20this%20list

Re: Filesystems mounting

2004-02-25 Thread Kenton Brede
On Wed, Feb 25, 2004 at 02:39:43PM -0800, Uma Lakshmanan ([EMAIL PROTECTED]) wrote: Hi , I am trying to write a script to see if a particular file system is mounted. If not I need to mount the file system. Is there a specific function that I could use for the file system. Thanks in advance.

Re: default value for input

2004-02-24 Thread Kenton Brede
On Tue, Feb 24, 2004 at 07:41:46PM +0100, Anthony Vanelverdinghe ([EMAIL PROTECTED]) wrote: Hi is it possible to give a default value to the input you're asking? I tried the code below but this didn't work. $URL = http://;; chomp ($URL = $URL.); I've set up a default variable like the

Re: variable issue

2004-02-24 Thread Kenton Brede
On Tue, Feb 24, 2004 at 10:49:50AM -0800, rmck ([EMAIL PROTECTED]) wrote: Help I need this variable $time to show last hour (00..23) So if hour is 00, I want 23. If hour is 01, I want 00, etc. snip Take a look at the localtime function. $ perldoc -f localtime hth, kent --

Re: default value for input

2004-02-24 Thread Kenton Brede
://http://whatever.com. I know that isn't very likely but . #!/usr/bin/perl use warnings; use strict; my $prefix = 'http://'; print Enter URL http://;; chomp (my $url = STDIN); if ($url =~ /http:/) { print $url\n; } else { print $prefix$url\n; } From: Kenton Brede [EMAIL

Re: Network Sniffer Module

2004-02-22 Thread Kenton Brede
On Sun, Feb 22, 2004 at 05:59:43PM -0500, Jason Normandin ([EMAIL PROTECTED]) wrote: Hi List. I am looking for a module that will allow me to perform the same function as the Solaris snoop command via Perl. I have searched CPAN, but was unable to I would rather not use the snoop command

Re: quotes in pattern

2004-02-21 Thread Kenton Brede
On Sat, Feb 21, 2004 at 07:44:15PM +0100, Anthony Vanelverdinghe ([EMAIL PROTECTED]) wrote: Hi I want to save the name and the URL of a html hyperlink in an array (@bookmarks). The problem is that the quotes aren't recognized, so it doesn't save only the URL; but also the other

Re: reading shell variables [Was all confused about a hash]

2004-02-21 Thread Kenton Brede
On Sun, Feb 22, 2004 at 12:30:14AM +, RichT ([EMAIL PROTECTED]) wrote: snip My next question is, how can i read in variables from the shell? im using Solaris / ksh You can access environment variables though the %ENV hash. I've listed a couple standard ways to do so below. If you are

Re: How i can get info about CPU ?

2004-02-16 Thread Kenton Brede
On Mon, Feb 16, 2004 at 01:07:50PM +0200, Angel Kolev ([EMAIL PROTECTED]) wrote: Exuseme for my bad english. How to get info for CPU: overloading, parameters, status .. etc for Windows and Linux? I wanna use that in my perl script. Your English is fine:) A good place to start for questions

Re: Date manipulation

2004-02-10 Thread Kenton Brede
On Tue, Feb 10, 2004 at 11:21:15AM +0100, Roger Grosswiler ([EMAIL PROTECTED]) wrote: hi list, i'd like to try a first perl-script that should: -define todays date -define todays date minus one week -find in a special directory files, that contain ddmmyy -remove them ..since i am an

Re: get_uid sub critic

2004-02-09 Thread Kenton Brede
On Mon, Feb 09, 2004 at 09:46:10AM -0500, Bob Showalter ([EMAIL PROTECTED]) wrote: Kenton Brede wrote: I've written the following subroutine to snag the next available UID in the 700 range from /etc/passwd. I then use the return value with useradd to add a new user. Note

get_uid sub critic

2004-02-07 Thread Kenton Brede
I've written the following subroutine to snag the next available UID in the 700 range from /etc/passwd. I then use the return value with useradd to add a new user. The subroutine works fine. If no UID 700 is found it returns 700. It then returns the next available UID or adds 1 to the last UID

Re: get_uid sub critic

2004-02-07 Thread Kenton Brede
On Sat, Feb 07, 2004 at 07:42:30PM -, Rob Dixon ([EMAIL PROTECTED]) wrote: Kenton Brede wrote: snip Hi Kenton. Hi, thanks for the great code. How does this look? Well ... complex :) Let me see if I can put this in English. sub get_uid { my %list; @list{map {(split

Re: get_uid sub critic

2004-02-07 Thread Kenton Brede
On Sat, Feb 07, 2004 at 02:08:26PM -0800, John W. Krahn ([EMAIL PROTECTED]) wrote: Kenton Brede wrote: I've written the following subroutine to snag the next available UID in the 700 range from /etc/passwd. I then use the return value with useradd to add a new user. The subroutine

Re: How Am I?

2004-02-04 Thread Kenton Brede
On Wed, Feb 04, 2004 at 12:18:49PM -, Rob Dixon ([EMAIL PROTECTED]) wrote: Rob Dixon wrote: [stuff] Sorry guys. Just glad it wasn't anything too embarrassing :-/ /R I posted an intimate message to a lady friend of mine once to the Debian users list. I know how you feel, hehe. I

Re: help on regular expression

2004-01-28 Thread Kenton Brede
On Tue, Jan 27, 2004 at 07:49:02AM -0800, Madhu Reddy ([EMAIL PROTECTED]) wrote: Hi, I need some help on regular expression... i have following in variable $total_count $total_count = ##I USBP 01 10:38:09(000) xyz_abc_etrack_validation,6 ETRACK_TOTAL_RECS : 100 Here in this

Re: function that reads line numbers?

2004-01-27 Thread Kenton Brede
On Tue, Jan 27, 2004 at 06:55:50PM -0800, Trina Espinoza ([EMAIL PROTECTED]) wrote: So this may be wishful thinking, but I would be kicking myself later if I didn't ask. Is there a function in perl where you give the function exact line numbers and it would only read the data in the range of

Re: the same script, the final step, and again does not do what I wnat it to do

2004-01-25 Thread Kenton Brede
On Sat, Jan 24, 2004 at 10:14:24PM -0700, danield ([EMAIL PROTECTED]) wrote: Hello all, Thanks to Charles and Tim, I have advanced to the final step with my script. After the script verifies that there is line (Summary Log...) and that the log is from correct year and month. I want it to

Re: Benchmark's cmpthese results - how to read

2004-01-25 Thread Kenton Brede
On Sun, Jan 25, 2004 at 01:59:30PM -0500, Kevin Old ([EMAIL PROTECTED]) wrote: Hello everyone, I have a two sets of code that I'd like to know which one is fastest, so I turned to the Benchmark module to help solve the mystery. My code: #!/usr/bin/perl use warnings; use strict; use

Re: Need help with a regex

2004-01-22 Thread Kenton Brede
On Fri, Jan 23, 2004 at 12:01:13AM -0500, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: This newbie needs help with a regex. Here's what the data from a text file looks like. There's no delimiter and the fields aren't evenly spaced apart. apples San Antonio Fruit oranges

Re: exit perl script and cd in bash?

2004-01-20 Thread Kenton Brede
On Sun, Jan 18, 2004 at 05:44:25PM -0600, Kenton Brede ([EMAIL PROTECTED]) wrote: I've been searching the archives and google for an answer. I suspect it can't be done but thought I'd ask. What I'm trying to do is create a tool such as cdargs, in perl, to simplify moving between

Re: Terminating script if file does not exist

2004-01-19 Thread Kenton Brede
On Mon, Jan 19, 2004 at 11:25:02PM -0500, perlwannabe ([EMAIL PROTECTED]) wrote: Basically the script runs and looks for a file in a certain directory. If the file is there, the script continues to run and process the file, but if the file is not there the script should just exit. Any ideas

Re: Matching and general expressions

2004-01-18 Thread Kenton Brede
On Sun, Jan 18, 2004 at 05:22:46PM +0100, aSH ([EMAIL PROTECTED]) wrote: Hello, I'm trying to learn and use the patterns. This is my first serious try with perl. I have a long list of words and phrases that I need to find. Let's take this example. I want to find this patterns anywhere,

Re: Building Perl 5.8.2 for distribution

2004-01-18 Thread Kenton Brede
On Sun, Jan 18, 2004 at 09:07:44AM -0500, Holler, Lesley W ([EMAIL PROTECTED]) wrote: Hi all, I am current attempting to build perl for distribution at my site. I want to build perl and all modules that I need in one directory, and distribute it in another. (*NOTE I want this to do

exit perl script and cd in bash?

2004-01-18 Thread Kenton Brede
I've been searching the archives and google for an answer. I suspect it can't be done but thought I'd ask. What I'm trying to do is create a tool such as cdargs, in perl, to simplify moving between directories on the command line. The problem I'm having of course is actually changing the

Re: multiline matching

2004-01-15 Thread Kenton Brede
On Thu, Jan 15, 2004 at 08:38:11AM -0600, James Edward Gray II ([EMAIL PROTECTED]) wrote: On Jan 14, 2004, at 10:28 PM, Kenton Brede wrote: On Wed, Jan 14, 2004 at 09:57:51PM -0600, James Edward Gray II ([EMAIL PROTECTED]) wrote: On Jan 14, 2004, at 7:22 PM, Jose Malacara wrote: snip

Re: multiline matching

2004-01-14 Thread Kenton Brede
On Wed, Jan 14, 2004 at 06:22:58PM -0700, Jose Malacara wrote: Can someone explain to me how to do multiline matching? I am trying to extract three consecutive lines from a datafile containing multiple records like this: Name: Bob City: Austin State: Texas Address: 123 Whatever Age: 46

Re: multiline matching

2004-01-14 Thread Kenton Brede
On Wed, Jan 14, 2004 at 09:57:51PM -0600, James Edward Gray II ([EMAIL PROTECTED]) wrote: On Jan 14, 2004, at 7:22 PM, Jose Malacara wrote: snip Since you've already been shown the super easy way, I'll dare to be a little different: #!/usr/bin/perl use strict; use warnings; $/ =

Re: adding the date::calc module

2004-01-03 Thread Kenton Brede
On Sat, Jan 03, 2004 at 08:56:42AM -0800, Stuart White wrote: I've been told that I can add the date::calc module from the command line using a one line command as opposed to going to perl.org and compiling it. Unfortunately though, I can't get into that email acct where that email with

Re: Ending a compound statement

2003-12-19 Thread Kenton Brede
On Thu, Dec 18, 2003 at 12:37:33PM -0800, drieux wrote: On Dec 18, 2003, at 11:35 AM, Kenton Brede wrote: http://nixnotes.org/perl_dump.html Thanks for everyones response first of all. So first things first, Do You REALLY want to know what @ARGV was prior to calling GetOptions? Point

Ending a compound statement

2003-12-18 Thread Kenton Brede
Does a compound statement need to end with an else ? I know - if (expression) { statement; } elsif (expression) { statement; } works but I've never seen a block like that in a book yet. I usually see something like - if (expression) { statement; } elsif (expression) {

Re: could use an audit

2003-12-14 Thread Kenton Brede
On Fri, Dec 12, 2003 at 06:20:45PM -0600, Kenton Brede wrote: I've cobbled some code together that will allow me to parse a file snip Thanks all for your help. I've learned a ton:) Kent -- I am always doing that which I can not do, in order that I may learn how to do it. --Pablo Picasso

Re: Split question

2003-12-13 Thread Kenton Brede
On Sat, Dec 13, 2003 at 09:16:35PM -0800, Perl wrote: Hi, i am new to Perl. here is my question i have a character string like abc#def#ghi#jkl i want to split the string based on the delimiter # so that i get something like this : abc def ghi jkl But

could use an audit

2003-12-12 Thread Kenton Brede
I've cobbled some code together that will allow me to parse a file snarfing 4 lines which consist of server name and Daily output of bandwith usage. I've pasted an example of what I have at the bottom of this mail. If anyone would like to take the time to show me how it should really be done I