Re: Date::Parse and strange dates

2014-07-26 Thread Janek Schleicher
rsedate=1224749208 Thu, 23 Oct 2008 12:06:48 +0400: str2time=1224749208 parsedate=1224749208 Greetings, Janek Schleicher PS: As Rob already mentioned, you should contact the author of Date::Parse also. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: balancing/distribution problem solution

2014-03-21 Thread Janek Schleicher
Am 21.03.2014 16:42, schrieb jbiskofski: I have 6 elevators, and 50 people. These people weigh between 120 and 350lbs. How can I find the optimal way of distributing these people into the 6 elevators so that each elevator carries approximately the same weight ? Hopefully the proposed solutions

Re: RegExp

2014-03-08 Thread Janek Schleicher
Am 08.03.2014 13:50, schrieb rakesh sharma: how do you get all words starting with letter 'r' in a string. What have you tried so far? Greetings, Janek -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: return just a match from an array without changing the array

2014-03-08 Thread Janek Schleicher
Am 04.03.2014 00:35, schrieb shawn wilson: So, when I do this: my $src = (grep {/.*(ARIN|APNIC).*(\n)?/; $1} @ret)[0]; I get a full line and not just the capture: # ARIN WHOIS data and services are subject to the Terms of Use When I do this: my $src = (grep {s/.*(ARIN|APNIC).*(\n)?/$1/} @r

Re: Delete first line when blank

2014-03-07 Thread Janek Schleicher
Am 07.03.2014 22:58, schrieb s...@missionstclare.com: I have some text files from which I would like to remove the first line, but only if it's blank. Any hints? I tried a few things, but the results haven't quite been satisfactory. perl -pi -e '$_ = "" if ( $. == 1 && /^\n/);' filename on c

Re: OO perl programming

2014-02-15 Thread Janek Schleicher
Am 13.02.2014 21:27, schrieb Uri Guttman: actually that isn't totally true. the concepts are fairly language independent but some languages have better support for OO than others. in particular it isn't hard to do OO even assembler (which i did) in that i grouped common data together and called s

Re: OO perl programming

2014-02-13 Thread Janek Schleicher
Am 05.02.2014 23:30, schrieb kavita kulkarni: Can somebody suggest me good book to learn/practice object oriented Perl programming. The usual answer is to study computer science. OO programming is the same independet of language. Greetings, Janek -- To unsubscribe, e-mail: beginners-unsubsc

Re: Gigantic file size processing error

2014-01-03 Thread Janek Schleicher
Am 02.01.2014 18:08, schrieb David Precious: Oh, I was thinking of a wrapper that would: (a) open a new temp file (b) iterate over the source file, line-by-line, calling the provided coderef for each line (c) write $_ (potentially modified by the coderef) to the temp file (d) finally, rename th

Re: inserting a variable server name into code

2013-12-20 Thread Janek Schleicher
Am 19.12.2013 19:27, schrieb Rick T: The following three lines are from a program that works fine for me. # Choose template file use constant TMPL_FILE => "/big/dom/xoldserver/www/templates/open_courses3.html"; my $tmpl = new HTML::Template( filename => TMPL_FILE ); I w

Re: Help needed with here documents (security?)

2013-10-24 Thread Janek Schleicher
Am 24.10.2013 15:07, schrieb Shawn H Corey: my $email = Email::Simple->create( header => [ From => $sender_addr, To => 'ad...@tristatelogic.com', X-Server-Protocol => $server_protocol, X-Http-User-Agent => $http_user_agent, X-Http-

Re: Help needed with here documents (security?)

2013-10-24 Thread Janek Schleicher
Another way of handling is to use one of the availabe Email::* modules on CPAN. This would have the advantages of (beside you don't have to worry about details of string quoting): - better code, as you write down what you intend to do instead of how you do it - better security, as those module

Re: Is there a way in PERL ......

2003-09-11 Thread Janek Schleicher
Anadi Taylor wrote at Thu, 11 Sep 2003 13:05:30 +: > I want to run a perl script that does a check and depending on the results > of that check i want to run different HTML pages. > For example: if the check is positive i want to run index1.htm else I want > to run index2.htm > > can this b

Re: Help on processinf Date String.

2003-09-10 Thread Janek Schleicher
Pandey Rajeev-A19514 wrote at Wed, 10 Sep 2003 11:56:01 +0530: > I have to start with input as date string which I need to process. > $date1 = "Wed Sep 10 15:51:50 CST 2003"; > $date2 = "15:52:00.885 cst Wed Sep 10 2003"; Here's a complete example working with Date::Manip. use Date::Manip; my $

Re: regexp

2003-08-26 Thread Janek Schleicher
Anton Arhipov wrote at Tue, 26 Aug 2003 13:02:00 +0300: > i've a string like "BLAH" (guotes included). > i need to control if the BLAH is in uppercase and then if it is in > uppercase truncate the quotes ("), so "BLAH" becomes BLAH. s/"([A-Z]+)"/$1/g; or on a POSIX operating system I would pref

Re: MailSender Quotes Problem

2003-08-26 Thread Janek Schleicher
Pablo Fischer wrote at Mon, 25 Aug 2003 23:51:47 +: > I was in a final test of my script and well it fails :-), however I found that > it fails in the form that Im creating the 'mail sender' object. > > If I do this: > smtp => '$this->{SMTP_SERVER}' (single quotes for elements) > > I get

Re: Benchmark times

2003-08-24 Thread Janek Schleicher
Pablo Fischer wrote at Sun, 24 Aug 2003 01:45:42 +: > This maybe its not a Perl question. I guess it ain't really not one. > I have a system (with 3 classes), that works in this order: > > > * Check in FTP for new files Time depends on the time to connect to FTP. However, the time is alwa

Re: a real newbie question!

2003-08-23 Thread Janek Schleicher
Robert Mark White wrote at Fri, 22 Aug 2003 23:37:48 -0600: > I see the "#!/usr/bin/perl -w" at the top of all programs. > I have read it tells perl where to run the program. No, it usually tells the (*nix) shell what program has to start - in this case /usr/bin/perl - and with what kind of argum

Re: Sick of Installing CPAN modules

2003-08-14 Thread Janek Schleicher
Nntp.Perl.Org wrote at Thu, 07 Aug 2003 13:32:39 -0700: > However, the Mail::MboxParser, the one that I really need still says it need > MIME::Tools. The actual module is called MIME::tools. I'm wondering if the > program is so stupid that it doesn't realize this ist he same thing. Or > perhaps

Re: Installing Modules

2003-08-14 Thread Janek Schleicher
sc0017 wrote at Mon, 11 Aug 2003 13:04:12 +0300: > Hi all i am newbie in perl! > > How could i install any module i want? Read perldoc -q install and perldoc perlmodinstall Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regex Pattern

2003-08-14 Thread Janek Schleicher
Jeff 'Japhy' Pinyan wrote at Thu, 07 Aug 2003 20:19:22 -0400: > my ($city, $state, $zip) = $line =~ /^(.*) ([A-Z]{2}) (\d{5,9})$/; > > This assumes the fields are separated by a space. It also only checks for > AT LEAST 4 and AT MOST 9 digits, so it would let a 7-digit zip code > through. If

Re: Pattern search a dir of filenames: Can use a scalar inside grep?

2003-08-14 Thread Janek Schleicher
Alan C. wrote at Thu, 07 Aug 2003 02:34:32 -0700: > It's my .* attempt I don't understand, seek help on. (seek/need > ability to either all files in dir opened or pattern search the files in > dir with only files that meet pattern opened) > > [...] > > my $filspec = '.*'; # brings error: per

Re: XML Document - DTD Validator

2003-08-14 Thread Janek Schleicher
Simran wrote at Fri, 08 Aug 2003 10:16:42 +1000: > Does anyone know of a good perl module through which i can validate XML > against a given DTD. > > Aka, i want to be able to give a perl function/method some XML data and > the DTD file location and want it to return if the XML data is valid > a

Re: List::Util / arrays

2003-08-14 Thread Janek Schleicher
Jakob Kofoed wrote at Tue, 05 Aug 2003 23:33:29 +0200: > I am trying to get the maximum number in a file looking like: > > 1 5001 > [...] > 19 5019 > > > I had the idea to push the individual line in a row into a array and se > the List::Util module - but I cant get it to work. Yet another

Re: System or Modules?

2003-08-14 Thread Janek Schleicher
Pablo Fischer wrote at Tue, 05 Aug 2003 01:58:35 +: > I finish a big part of a script. Cause Im working with command to 'cp', > 'remove', 'move','make directories' Im using certain Modules to do that, > however I would like to know whats better in perl, to use the 'system' > command or to u

Re: quick re help

2003-08-14 Thread Janek Schleicher
[EMAIL PROTECTED] wrote at Wed, 13 Aug 2003 15:22:59 -0600: >>>sub quickWrap { >>> my $data = @_[0]; >> >> >> You shouldn't use an array slice where you mean to use a single array >> element. >> > > Thanks for catching that, I should have really seen that one. No, Perl should have seen it

Re: Help with Unlink please

2003-08-08 Thread Janek Schleicher
Steve Grazzini wrote at Wed, 06 Aug 2003 23:38:00 -0400: > On Wed, Aug 06, 2003 at 11:49:20PM -0400, perlwannabe wrote: >> I have made the script as simple as possible and cannot get >> unlink to work. >> >> unlink ("c:\testdir\*030977*.*") || die "unlink failed: $!"; > > You'd need to expand t

Re: [New Question] Large file line by line

2003-08-07 Thread Janek Schleicher
Pablo Fischer wrote at Tue, 05 Aug 2003 15:43:19 +: > Reading all these message about reading a 'big' file (I know that 180MB its > not a big file), but what's the difference from reading like this: > > @file = ; That reads all lines of a file into the @file array. That means, at least all

Re: How to replace a text in a file

2003-08-07 Thread Janek Schleicher
Vinay Thombre wrote at Tue, 05 Aug 2003 17:31:32 +0530: > I am novice to Perl and learning very basic things. I want to replace a > text in a file with new text. I want to do it programatically. How can I > do that? What have you learned so far yet? What is your tutorial? What does it say about

Re: Line Numbering

2003-08-01 Thread Janek Schleicher
johnston wrote at Fri, 01 Aug 2003 14:15:18 +0800: > My stupid question number one is: When Perl processes the script, how > does it identify the lines of code? ie.. If an error occurs at line 125, > is that the 125'th line of actual code, or does it count every single line > in the script fr

Re: [solved but..] Push first 9 elements

2003-08-01 Thread Janek Schleicher
John W. Krahn wrote at Thu, 31 Jul 2003 00:22:04 -0700: > If you are just removing one element then you can use shift instead. > And you are not really using $i it seems. > > for ( 0 .. @archivo - 4 ) { > push @lista_final, shift @correos_p; > push @lista_final, shift @correos_h; >

Re: What's Better?

2003-08-01 Thread Janek Schleicher
Pablo Fischer wrote at Thu, 31 Jul 2003 18:52:20 +: > I have 10 files, each file has 3000 lines. I have two options but I need to > know which option is better in disk space and in cpu (the fastest one when I > need th edata): > > 1. Keep the 10 files in one Zip, and When its time to use th

Re: perl/Tk

2003-07-31 Thread Janek Schleicher
Frank B. Ehrenfried wrote at Wed, 30 Jul 2003 15:34:01 -0700: > I have downloaded the perl/tk module Tk804.02 from CPAN.ORG. I've > unzipped and untarred it and placed it and it sub-directories uner "/". > But my perl script can not find it. I get the response "Cann't locate > Tk.pm in @INC".

Re: Local variables

2003-07-27 Thread Janek Schleicher
Pablo Fischer wrote at Sun, 27 Jul 2003 11:59:59 +: > I have a Pretty class, with 15 methods (or more). I was reading a Perl > Tutorial and read that I could create local variables. So In many of my > methods Im using variables, but Im not declaring them like 'local $var', just > like 'my $

Re: Case Statement

2003-07-27 Thread Janek Schleicher
Pablo Fischer wrote at Sat, 26 Jul 2003 23:35:14 +: > I need to evaluate a lot of conditionals, and of course the use of a lot of > if's its not the 'right' way, so Im using something like this: > > CASE: { > ($string == "match1") && do { > actions.. > last CASE; > };

Re: Split FileName

2003-07-26 Thread Janek Schleicher
Pablo Fischer wrote at Fri, 25 Jul 2003 13:49:55 +: > I have a string (its an array, the array has the values that $ftp->ls("dir) > returns), so $array[1] contains this: > -rw-r--r-- 1 pablopablo 18944 Jul 16 21:14 File28903.zip > > What I would like to do is: get the date (Jul 1

Re: performance tuning in perl

2003-07-25 Thread Janek Schleicher
Phil Schaechter wrote at Thu, 24 Jul 2003 15:32:49 -0700: > Does anyone know of any performance tuning tools for perl? I'd like to > analyze my programs to see where it is spending the most time. > > If anyone has any suggesstions, I'd appreciate it. Well, the simplest tool is definitly the Be

Re: matching file names starting with a dot (was: REGEX PROBLEM)

2003-07-25 Thread Janek Schleicher
magelor wrote at Fri, 25 Jul 2003 11:09:03 +0200: > /tmp/test/.test.txt > /tmp/test/hallo.txt > /tmp/test/xyz/abc.txt > /var/log/ksy/123.log > > > now i need a regex that matches all lines but the one that contains a > filename starting with a point. like ".test.txt". how can i do that? > > thi

Re: modifing and writing to a file

2003-07-24 Thread Janek Schleicher
Ged wrote at Thu, 24 Jul 2003 08:00:04 +: > I am very new to perl (2 days) but am finding it very rewarding. I have however > stumbled across a problem hopefully somebody can help me with. > > I am trying to open a file, change the text from lowercase to uppercase and rewrite > it to a back

Re: Removing duplicate lines.

2003-07-21 Thread Janek Schleicher
Jonathan Musto wrote at Mon, 21 Jul 2003 13:11:10 +0100: > I have a text file which contains a list of companies: > > NORTH DOWN AND ARDS INSTITUTE > NOTTINGHAM HEALTH AUTHORITY > 1ST CONTACT GROUP LTD > 1ST CONTACT GROUP LTD > 1ST CONTACT GROUP LTD > 1ST CONTACT GROUP LTD > 4D TELECOM & KINGSTO

Re: Regular Expression (fwd)

2003-07-18 Thread Janek Schleicher
Trensett wrote at Wed, 16 Jul 2003 18:29:51 -0500: >> The next will work: >> my @variable = $string =~ /\((.*?)\)/g; > > what's the exact implication of ".*?"? > Why wouldn't just .* in parenthesis work for this case? A good answer can also be found in perldoc perlre and perldoc -q greedy Gree

Re: Is there a simple way to include source code I've written in other files?

2003-07-18 Thread Janek Schleicher
Jamie Risk wrote at Thu, 17 Jul 2003 10:39:56 -0400: > Until now, I've avoided writing modules by inlining the deisred code in the > new files. Messy. I'm avoiding modules for two reasons, laziness and naive > conception that for what I'm trying to do it's overkill. > > Is there a method to refe

Re: Assigning a singe value to a list

2003-07-18 Thread Janek Schleicher
Paul D. Kraus wrote at Thu, 17 Jul 2003 15:33:11 -0400: > Is there a way to assign a single value to a list? other then doing the > obvious and spelling out each list assignment or running through a loop. > > For instance... > > my ( $var1, $var2, $var3, ... ) = "Paul" > assigning paul to all va

RE: Porting perl scripts on windows

2003-07-17 Thread Janek Schleicher
Sharad Gupta wrote at Wed, 16 Jul 2003 21:03:49 -0700: > Ok, Let me try to put it the other way. > > Any good books on how to learn perl on windows??. What about "Learning Perl on Win32 Systems" by Randal L. Schwartz, Tom Christiansen, Erik Olsen from O'Reilly Greetings, Janek -- To unsubscr

Re: Regular Expression

2003-07-16 Thread Janek Schleicher
Nick Diel wrote at Tue, 15 Jul 2003 11:12:18 -0600: > I am having a hard time getting a regular expression to work the way i want > it to. Take the following text: bla bla bla (la la) bla bla (di da) > > I want to extract the la la to one variable and di da to antoher variable. > What I have tr

Re: Question on For loop usage in Perl

2003-07-13 Thread Janek Schleicher
Hari Krishnaan wrote at Thu, 10 Jul 2003 14:03:32 -0700: > I was using a for loop in the following manner in one of my perl programs. > > for($j=31, $n=$initial;$j>=0,$n<=$final;$j--,$n++) { > > # Executing statements here > } > } > 1) Is it legal in perl to use the for loop as mentioned above

Re: How to get a file

2003-07-13 Thread Janek Schleicher
Vemulakonda Uday Bhaskar wrote at Fri, 11 Jul 2003 08:44:16 +: > my $SFTP=Net::SSH::Perl->new("xxx.xxx.xxx.xxx") or die "Cant connect"; > $sftp->login("xyz","abc"); > > the above code is working fine. How do you know that the code is working fine? I don't know the Net::SSH::Perl module very

Re: Perl on Visual studio

2003-07-13 Thread Janek Schleicher
Ronen Kfir wrote at Sun, 13 Jul 2003 19:29:27 +0300: > I hold the visual studio .net professional CD. How do I install perl on > it? Installed the windows compenents cd. Now I can see a setup page with > checkboxes I have to choose from. Things like: Path > Languege tools > Etc. > docomuntaation

Re: $! and $@

2003-07-08 Thread Janek Schleicher
Jdavis wrote at Tue, 08 Jul 2003 14:39:17 -0600: > I think these catch errors somehow... > > $! and $@ > > could someone explain this. Perl can explain it to you, just read: perldoc perlvar Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: CR at end of line - how do I parse this?

2003-07-08 Thread Janek Schleicher
Christopher Fuchs wrote at Tue, 08 Jul 2003 14:29:50 -0700: > I have a perl script on UNIX which works properly for an ASCII > input data file which is in the form of: > > record 1 line 1 > record 1 line 2 > record 1 line 3^M > record 2 line 1 > etc > > The record delimiter is ^M (which is somet

Re: Net::NNTP List does not work

2003-07-08 Thread Janek Schleicher
Gene Mat wrote at Mon, 07 Jul 2003 23:18:38 +: > I am trying to call the list function using NET::NNTP. > > use Net::NNTP; use strict; use warnings; would have told you where and why the error is. > $nntp = Net::NNTP->new("nntp.perl.org",Debug,10); > ($narticles,$first,$last,$GROUP)=$nntp-

Re: Perl SFTP help

2003-07-07 Thread Janek Schleicher
Vemulakonda Uday Bhaskar wrote at Mon, 07 Jul 2003 13:21:53 +: > use strict; > use warnings; > > #!usr/bin/perl The usual ordering is to have that line as first line, followed by use strict; use warnings in the next lines. > use Net::SFTP: > my $sftp=Net::sftp->new("xxx.xxx.xxx.xxx");

Re: Stat() - Getting one element

2003-07-07 Thread Janek Schleicher
Paul Kraus wrote at Mon, 07 Jul 2003 09:27:15 -0400: > What's an easy way to grab just one element out of a function that > returns a list. > > For instance if I was to stat a file and all I wanted was the $atime or > if I just wanted the three timestamps atime mtime and ctime. Thanks. A complet

Re: newbie needs help

2003-07-07 Thread Janek Schleicher
Dakenah Johnson wrote at Mon, 07 Jul 2003 10:11:37 +: > I am writing a script that uses backquotes and the ps-ef command to print > the UID and command for all currently running processes. You can also use a module instead of reinventing the wheel :-) Have a look to the CPAN module Proc::Pro

Re: formatting a number

2003-07-04 Thread Janek Schleicher
Robert Citek wrote at Thu, 03 Jul 2003 18:48:02 -0500: > I want to format a number so that it has commas as a separator. Here's the > code I came up with: > > my $num=12345678; > print scalar reverse( join(",", grep( /./ ,split > (/(...)/,reverse($num), "\n"; > > This works but was wonderin

Re: noch ein kleines problem mit meinem script

2003-07-03 Thread Janek Schleicher
Azubi Cai wrote at Thu, 03 Jul 2003 09:53:57 +0200: > Das sieht jetzt so aus: > > #!/usr/bin/perl -w > use CGI::Carp qw(fatalsToBrowser); > use CGI; > > $cgi = new CGI; > my $params = Vars; > my %Formular = %params; ^ my %Formular = %$params; ^^ > open PLATZ

Re: Newlines, control characters, etc

2003-07-02 Thread Janek Schleicher
Joshua Scott wrote at Wed, 02 Jul 2003 21:25:34 -0400: > I'm trying to copy data from one database field to another. The problem is > that the field contains various newline and other types of control > characters. Whenever the script runs, it processes those as perl code > instead of data like

RE: -w vs. use warnings

2003-07-02 Thread Janek Schleicher
Charles K. Clarkson wrote at Wed, 02 Jul 2003 13:43:26 -0500: > Read 'perlexwarn' in the perl documentation ^ Better to read perldoc perllexwarn ^^ > for a complete discussion. Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

Re: Regex question

2003-07-01 Thread Janek Schleicher
Jeff 'Japhy' Pinyan wrote at Tue, 01 Jul 2003 12:39:37 -0400: > On Jul 1, [EMAIL PROTECTED] said: > >>\.[^(gz|html)]$ >> >>this regex should match all files (lines) NOT ending with gz or html. > > or else use a negative look-ahead: > > if ($filename =~ /\.(?!gz|html)[^.]*$/) { > # (?!...)

Re: Question about filehandles

2003-07-01 Thread Janek Schleicher
Azubi Cai wrote at Tue, 01 Jul 2003 16:40:23 +0200: > I need to substitute a string in a .rtf file with a string from an HTML > form. > I thought about using placeholders in the .rtf document and then > searching and overwriting them with the data from the HTML form. > I tried it out with that cod

Re: password encrytion perl help

2003-07-01 Thread Janek Schleicher
Vemulakonda Uday Bhaskar wrote at Tue, 01 Jul 2003 09:11:00 +: > my code looks like this: > > #!/usr/bin/perl Missing use strict; use warnings; > $ftp=Net::FTP->new("xxx.xxx.xxx.xxx") else die "not connected"; or > $u=; > CHOMP $u; ^ cho

Re: How to check Array Uniqueness without Modul Array::unique

2003-07-01 Thread Janek Schleicher
B. Fongo wrote at Mon, 30 Jun 2003 23:46:19 +0200: > Is there any other way to check array uniqueness except the Module > Array::Unique? > I'm having problems in installing these two Modules: Array::Unique and > Tie. So I'm thinking of another way to check array for replicates. > > I help will b

Re: help needed

2003-06-30 Thread Janek Schleicher
Vemulakonda Uday Bhaskar wrote at Mon, 30 Jun 2003 09:37:31 +: > but some error is coming > from where do i download Net::SCP. is this code ok http://search.cpan.org Greetings, Janek PS: Don't post your messages more than one times. Otherwise you could get plonked by one or others. -

Re: Count Function?

2003-06-27 Thread Janek Schleicher
Nelson Ray wrote at Thu, 26 Jun 2003 19:25:37 -0700: > Does anyone know of any sort of a function or method in perl that returns > the number of times a search string exists in a scalar. Say, how many "a's" > are there in this sentence? I am able to write it myself, but I was > wondering if Perl

Re: Matching

2003-06-26 Thread Janek Schleicher
Sitha Nhok wrote at Thu, 26 Jun 2003 12:47:25 -0400: > Is there anyway to match a string in a 2-dimensional array only at one > index? For example, say I have this 2-d array: > > @AoA = ( > ["ABC", "BCD"], > ["CDE", "DEF"], > ["EFG", "FGH"], >

Re: help - perl ssh

2003-06-26 Thread Janek Schleicher
Vemulakonda Uday Bhaskar wrote at Thu, 26 Jun 2003 12:41:16 +: > i have wriiten a code for file tranfer between linux systems > so i used Net::SCP qw(scp iscp). > > i downloaded it from the site > http://serach.cpan.org/author/IVAN > > but after gunzip and tar -xvf.. > when i gave the comma

Re: Please explain warnings error

2003-06-26 Thread Janek Schleicher
Motherofperl wrote at Thu, 26 Jun 2003 08:35:05 -0400: > I'm getting this warning: Possible unintended interpolation of @pkg::array1 > in string > > What does it mean and how do I fix it? Let Perl explain it to you, include not only strict and warnings, also use diagnostics; If you still do

Re: Weekly list FAQ posting

2003-06-26 Thread Janek Schleicher
Jenda Krynicky wrote at Thu, 26 Jun 2003 14:05:14 +0200: >> case wrote at Tue, 24 Jun 2003 15:17:48 +: >> >> > 2.9 Other tips before posting to the list >> > * Check the FAQs first >> >> once >> >> > * Don't send questions asking "... will this work?". Try it >> > first, then

Re: help:Perl ssh file tranfer

2003-06-26 Thread Janek Schleicher
Vemulakonda Uday Bhaskar wrote at Thu, 26 Jun 2003 10:14:22 +: > please help me with the code which does the following : Where is the code? > transfer of files from one system through another system which are > both working on linux through ssh > > as iam in need of it urgently, exepecting

Re: Weekly list FAQ posting

2003-06-26 Thread Janek Schleicher
case wrote at Tue, 24 Jun 2003 15:17:48 +: > 2.9 Other tips before posting to the list > * Check the FAQs first once > * Don't send questions asking "... will this work?". Try it first, then > report errors and ask the list why it *didn't* work. A good answer to > "will thi

Re: MD5 module

2003-06-25 Thread Janek Schleicher
Mario Kulka wrote at Wed, 25 Jun 2003 19:36:45 +: > Few days ago I sent a message about uploading modules but I just realized I > wasn't subscribed to the list. I just re-subscribed but I missed the replys; > is there a way to view the last messages posted to the list by date or > something

Re: Help needed on XML Files

2003-06-24 Thread Janek Schleicher
Sherwin Remo wrote at Tue, 24 Jun 2003 06:56:40 +0800: > I would like to write a script that would check the correct syntax of an XML > file. Need to check if the file is XML compliant. Is there a module that I > can use to do this? Thanks! There are a lot of XML modules on CPAN: http://search

Re: Why

2003-06-23 Thread Janek Schleicher
Scott_g wrote at Sun, 22 Jun 2003 15:21:24 -0500: > Hello. I am new to Perl. I used to program in C years ago (not C++ # > etc) > > I have the simplest question. I am running active state perl 5 on Win > XP. > > I'm using OpenPERL Ide 1.0 > > #!k:/perl/bin/perl.exe > # > # Camel-Learning Perl >

Re: installing modules

2003-06-23 Thread Janek Schleicher
Mario Kulka wrote at Mon, 23 Jun 2003 03:40:03 +: > Could anyone give me step by tep instructions on how to install a perl > module (MD5) on my host server. How come they don't have it installed? Isn't > popular enough? BTW, the MD5 module is deprecated. It is recommended to install Digest:

Re: perl reg exp problem

2003-06-23 Thread Janek Schleicher
Robin Garbutt wrote at Mon, 23 Jun 2003 11:40:47 +0100: > I have a string that is a random sequence like the following:- > > ACGTCGTCGTCACACACACGCGTCTCTATACGCG > > I want to be able to parse the string, picking out any TATA sequences, > colour them in red and make a not of where ther lie in the

Re: perldoc - html format ?

2003-06-20 Thread Janek Schleicher
Jeff Westman wrote at Fri, 20 Jun 2003 11:33:59 -0700: > Is it possible to reformat a perldoc in HTML format? > I don't see this as an option to 'perldoc'. From perldoc perldoc -o output-formatname This specifies that you want Perldoc to try using a Pod-formatting c

Re: Problem with making the Perl Module Date::Calc

2003-06-20 Thread Janek Schleicher
Anand Babu wrote at Fri, 20 Jun 2003 12:32:22 -0700: > Warning: prerequisite Bit::Vector failed to load: Can't locate Bit/Vector.pm in Seeing this warning I would recommend you also to install the module Bit::Vector Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: format

2003-06-20 Thread Janek Schleicher
Ataualpa Albert Carmo Braga wrote at Fri, 20 Jun 2003 02:28:11 -0300: > I did a small script with perl and I'd like to format the output: > > C -3.7975162.078833-0.795507 > C 4.0463240.905644-0.106181 > C 4.0372860.8874121.283492 >

Re: mathing only one type of characters

2003-06-11 Thread Janek Schleicher
Pedro Antonio Reche wrote at Wed, 11 Jun 2003 13:38:18 -0500: > I would like to match a string if it has only cero or more of a defined > set of characters. > For example: > if "GACT" are the characters, then > > GACTNGACT ## This string should not be matched because it has the extra > charact

Re: regexp

2003-06-11 Thread Janek Schleicher
Jaschar Otto wrote at Wed, 11 Jun 2003 11:53:11 +0200: > i've got a problem with regexp, > i have a multiline string like > > this is > a multi > line string > > > > and i want to do a regexp that replaces > everything that is NOT "a","b","c" or "d" > with \s, except \n of course. \s is not

Re: How can I find the module version?

2003-06-10 Thread Janek Schleicher
Rick Ressegger wrote at Tue, 10 Jun 2003 09:32:53 -0400: > If I want to know what version of a module is already installed on a system, > how can I disclose this? A simple way that works often is perl -MModule::Name -e 'print $Module::Name::VERSION' Another way would be e.g. to use the CPAN modu

Re: Spliting comma delimited data

2003-06-09 Thread Janek Schleicher
Rob Anderson wrote at Mon, 09 Jun 2003 16:08:54 +0100: > I have the following code, which I intend to use to save/restore an array > to/from a text file with. > > As I'm using a comma to delilmit the data I'm escaping commas on the way > out, an unescaping on the way in. This means that when I sp

Re: typing files quickly

2003-06-09 Thread Janek Schleicher
Harry Putnam wrote at Sat, 07 Jun 2003 02:18:32 -0700: >> So you can use: >> >> if (-f $file) { >> : >> # process file >> } >> elsif (-d $file) { >> : >> # process directory >> } >> } > Well, yes of course I can run each filename thru all those tests, but that > seems kin

Re: Why "Can't locate auto/Heap/add.al"?

2003-06-09 Thread Janek Schleicher
Ying Liu wrote at Thu, 05 Jun 2003 20:20:02 -0500: > I finally install the Heap module. But I run the example of the CPAN: > foreach $i ( 1..100 ) >{ >$elem = NumElem($i); >$heap->add($elem); >} >} > It told me: > Can't locate auto/Heap/add.al in @INC > > I search thi

Re: Perl - Web Development

2003-06-05 Thread Janek Schleicher
Paul Kraus wrote at Wed, 04 Jun 2003 09:49:10 -0400: > This may be asking for biased opinions but here goes anyways... > > Is perl still a good choice for the web. For instance I need to setup a > couple sites that are going to be running on IIS. Is perl still a good > choice for speed ect... In

Re: Am i taking the right approach (i have to learn to code this!)

2003-06-05 Thread Janek Schleicher
Angel Gabriel wrote at Wed, 04 Jun 2003 17:44:28 +0100: > As some of you know, I'm attempting to create an internal system to > automate some stuff. This is how I plan to do this... Year, that's exactly the way, you should start. It will be possible to translate your pseudo code nearly 1:1 to Per

Re: Installing Heap Module

2003-06-04 Thread Janek Schleicher
Ying Liu wrote at Tue, 03 Jun 2003 15:45:32 -0500: > [...] > After I changed all those folders, I can install the Heap module > succssfully. > > But when I use it by: > use Heap "/mz/hd/liuyi/local/Heap-0.50" > > It said: > Can't locate Heap/Fibonacci.pm in @INC (@INC contains: > /usr/perl5/5.00

Re: sorry about how simple this question is

2003-06-04 Thread Janek Schleicher
Klinsitik Reckon wrote at Tue, 03 Jun 2003 19:16:01 -0700: > I am just starting to learn with perl. What software, > books, or web sites would be helpful to learning the > VERY basics of this new language. I do have some > knowledge ofprogramming(in HTML, JavaScript, and > C). Not much though.

Re: Regular expressions

2003-06-04 Thread Janek Schleicher
Saurabh Singhvi wrote at Tue, 03 Jun 2003 22:38:47 -0700: > well i was trying to understand the "regular > expressions" in perl when i came across i > tried my best but i havent been able to get the > slightest idea on how the input thing works. The > editor i use is DzSoft. And it shows somethin

Re: Installing Heap Module

2003-06-03 Thread Janek Schleicher
Ying Liu wrote at Fri, 30 May 2003 10:48:06 -0500: > When I install Heap module, I don't have the superuser permission and set > the install location by run: > %perl Makefile.PL PREFIX=/mz/hd/liuyi/local/Heap-0.50 > %make > %make test > > The above three commands run OK, but after I run '%make in

Re: arrays and hashes

2003-06-03 Thread Janek Schleicher
John W. Krahn wrote at Mon, 02 Jun 2003 14:44:41 -0700: > You should probably use an array to keep the correct order and a hash to > keep the count: Or to use Tie::IxHash. Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: DBI:mysql

2003-04-03 Thread Janek Schleicher
Jaws wrote at Thu, 03 Apr 2003 14:47:02 +0800: > I tried using the following: > > my $sth = $dbh->prepare(q{INSERT INTO MYTABLE (USERNAME,PASSWORD) VALUES (?, ?) > }) or die $dbh->errstr; > $sth->execute($username,PASSWORD('$pass')) or die $dbh->errstr; > $dbh->disconnect; >

Re: $|

2003-03-30 Thread Janek Schleicher
Rob Dixon wrote at Sat, 29 Mar 2003 12:59:22 +: >>$| If set to nonzero, forces a flush right away and >> [ ... ] >> > I'll throw in my usual thing here: that it's better to use > > use IO::Handle;# a standard module > > autoflush STDOUT; Looks really good :-) >

Re: $|

2003-03-29 Thread Janek Schleicher
Dan wrote at Sat, 29 Mar 2003 10:20:33 +: > Just a quick question, what is the meaning of this $| and what is it > supposed to do? From perldoc perlvar $| If set to nonzero, forces a flush right away and after every write or print on the currently se

Re: Enumerating available modules

2003-03-28 Thread Janek Schleicher
Steve Gilbert wrote at Fri, 28 Mar 2003 09:28:17 -0800: > Does anyone know of a way to enumerate all the > available modules on a system? Have a look to the CPAN module ExtUtils::Installed Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: Variable scoping, static variable

2003-03-28 Thread Janek Schleicher
Rob Anderson wrote at Fri, 28 Mar 2003 14:45:07 +: > -- module sub routine > > sub test { > my $param = shift; > my $cache_key = "param=$param"; > if (exists $cache{$cache_key}) { > return $cache{$cache_key}; > } > sleep 1; > $cache{$cache_key} = $

Re: Split Problem

2003-03-27 Thread Janek Schleicher
Rob Dixon wrote at Thu, 27 Mar 2003 12:51:46 +: > Janek Schleicher wrote: >> > $data = "David (man from uncle)"; >> > >> > $data = "John Doe (The boy down the hall)"; >> > >> > What I want to do is split $data into two

Re: Split Problem

2003-03-27 Thread Janek Schleicher
Stefan Lidman wrote at Thu, 27 Mar 2003 13:55:27 +0100: > Janek Schleicher wrote: >> I would use a regexp: >> >> my ($name, $info) = $data =~ /(.*?)\w+\((.*)\)/; > > I guess you ment: > my ($name, $info) = $data =~ /(.*?)\s*\((.*)\)/; Yep. Cheerio, Janek --

Re: Split Problem

2003-03-27 Thread Janek Schleicher
Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500: > $data = "David (man from uncle)"; > > $data = "John Doe (The boy down the hall)"; > > What I want to do is split $data into two string variables, one holding the > $name, and the other holding all the $info that is within the parens. How

Re: Binary File Reading

2003-03-26 Thread Janek Schleicher
Chrkôkî‰éán™îkï wrote at Wed, 26 Mar 2003 12:34:15 -0300: > I'm new in Perl, and I need to analyze a binary file, byte per byte. > > $/ = undef; > open FILE, "file.bin" or die $!; > binmode FILE; > my $data = ; > > is that ok? how can I get one byte, the next, the next, etc? > Thanks i

Re: how can I delete a line?

2003-03-26 Thread Janek Schleicher
Adriano Allora wrote at Tue, 25 Mar 2003 15:39:14 -0800: > hello, > I need to delete single lines in a text (for example the 132nd, the 133rd and the > 134th ones). > How can I do it in a structure like: > > if $. = selected number > line = "" > As TMTWTDI, here's another one: whi

  1   2   3   4   >