Re: pulling multiple lines from a file

2001-11-16 Thread Chris Garringer
One way (probably not the most elegant) set a flag variable to 0 my $flagv=0 foreach to read file { $flag=1 if (/^NC00/); if ($flag) { store line increment counter if counter >5 $flag=0 } -- Chris D. Garringer LAN/WAN Supervisor Toshiba International 713-466-0277 x

Re: problem comparing strings

2001-11-14 Thread Chris Garringer
chomp $character; You need to get rid of the newline character at the end of every string from On Wed, 14 Nov 2001, samuel wrote: > Hi there! > i'm seeking for help on something which should b easy, but has > turned into my personal hell. > i'm trying to compare character (but i guess it appl

Windows drive mapping in perl

2001-09-26 Thread Chris Garringer
Recently I had a problem where I had to loop through a set of shares (actually NetWare servers and volumes), map a drive, execute a program (that requires a drive mapping, UNC will not work), delete the drive mapping. I could not find a way to map/unmap a drive in Perl. I ended up calling a b

RE: Win32::Eventlog on ActiveState

2001-08-10 Thread Chris Garringer
Odom" <[EMAIL PROTECTED]> 08/10/01 10:01AM >>> Chris Garringer [mailto:[EMAIL PROTECTED]] said: > > I need to read a Win2k Event log (Application). > ... > I got the Win32::Eventlog module and setup per the documentation > ... > use Win32::Eventlog; > ... &g

Win32::Eventlog on ActiveState

2001-08-10 Thread Chris Garringer
I need to read a Win2k Event log (Application). I am running Active State (downloaded last week) on this machine. I got the Win32::Eventlog module and setup per the documentation (I think) use strict; use Win32::Eventlog; .. $Win32::Eventlog::GetMessageText=1; my $evtflags=$Win32::Eventlog::E

Re: formatting columns

2001-08-06 Thread Chris Garringer
Excel should only see the \t character. It sounds as though the \t is not being picked up correctly. Have you tried a comma delimiter? It not Perl, but I have had better luck with comma or semi-colon delimiters with Excel. Chris D. Garringer LAN/WAN Manager Master Certified Netware Engineer

Win32 and File Globbing

2001-08-06 Thread Chris Garringer
I am attempting to write a log analysis program in Perl for a Windows app. I normally use Linux/Unix so Bill'sMoneyMachine can frustrate me. Log files are generated when 1) the program restarts, or 2) the file size exceeds 10MB. So I need to pass to the program a file spec to catch 1 days log

Printing a data structure

2001-08-01 Thread Chris Garringer
I have a data structure $logs[]{}{}[] that has the data parsed from a log file. I need to print the structure in a form that managment can understand. My problem is, I can fill the structure correctly but cannot seem to get a handle on printing it to allow printing the parts in a decent form.

Printing a array of hashes of hashes of arrays

2001-07-31 Thread Chris Garringer
I think that is right, I admit that Perl's data structures confuse me and I don' t have it right yet. I have a program that has an array of days of the month, the array value is a hash, the value of the hash is a hash, and its value is an array $logs[$day]{}{}[] This structure works fine to loa

Re: $_ question

2001-07-27 Thread Chris Garringer
Blunder matches on the under at the end of the string. If you want to match only under m/^under$/ Chris D. Garringer LAN/WAN Manager Master Certified Netware Engineer Microsoft Certified Systems Engineer Certified Solaris Administrator Red Hat Certified Engineer [EMAIL PROTECTED] fax 713-896-526

Re: open FILE problem

2001-07-12 Thread Chris Garringer
ls format is OS dependant. On Solaris ls returns a multiple column list, so the first line would be multiple filenames. Chris D. Garringer LAN/WAN Manager Master Certified Netware Engineer Microsoft Certified Systems Engineer Certified Solaris Administrator Red Hat Certified Engineer [EMAIL PROT

Re: I feel like an idiot...

2001-06-20 Thread Chris Garringer
Its not matching a blank line somewhere in the file try /^(\d{3})/ && $users{$1} = "Offline"; so a key is created only if the match succeeds Chris D. Garringer LAN/WAN Manager Master Certified Netware Engineer Microsoft Certified Systems Engineer Certified Solaris Administrator Red Hat

Re: I feel like an idiot...

2001-06-20 Thread Chris Garringer
Try $item=~/^\d{3}/; Chris D. Garringer LAN/WAN Manager Master Certified Netware Engineer Microsoft Certified Systems Engineer Certified Solaris Administrator Red Hat Certified Engineer [EMAIL PROTECTED] fax 713-896-5266 >>> Tom Yarrish <[EMAIL PROTECTED]> 06/20/01 01:51PM >>> Hey all, Well, th

Re: Stuck in the Perl Beginners Panic-Zone!

2001-06-15 Thread Chris Garringer
I've run Activestate perl on NT and W2000. On NT I had to use perl . On 2000 I only need the program name. What would be required on a "consumer" rather that "business' M$ Operating system I don't know. It "should" be a matter of associating the extension you are using with the perl program