Re: How to import symbols and semantics from one namespace into another

2004-01-28 Thread Tassilo von Parseval
On Wed, Jan 28, 2004 at 01:32:14PM -0500 [EMAIL PROTECTED] wrote: > Hi, this question has to do with importing names from one package into > another. In my case, both packages reside in the same file, and I > simply want to import all the package-global symbols from the one > package into the oth

Re: [Q] How to eval an EXPR once and make it stick

2004-01-28 Thread Tassilo von Parseval
On Wed, Jan 28, 2004 at 09:11:51AM -0800 Sam wrote: > 4. As for the generalized case, I learned about using refs. Anonymous subs > also work. > > my $re = sub { return /^\s*$/; }; > my $nre = sub { return not &$re; }; > my $expr = $blank ? $re : $nre; > do ... while (&$expr and not eof); >

Re: variable FORMAT in printf?

2004-01-19 Thread Tassilo von Parseval
On Sun, Jan 18, 2004 at 09:53:56PM -0700 Bryan Harris wrote: > I've tried everything I can think of, but I feel like a 6th grader trying to > solve a 7th grade math problem: > > I'm trying to build a "pretty-fier" for any tab-delimited text file > (basically space-pad the columns so the decimals

Re: Why isn't perl used more in business and industry

2004-01-18 Thread Tassilo von Parseval
On Sat, Jan 17, 2004 at 06:52:27PM -0600 James Edward Gray II wrote: > On Jan 17, 2004, at 3:51 PM, James Edward Gray II wrote: > > >A recent article on Perl.com covered this a little: > > > >http://www.perl.com/pub/a/2004/01/09/survey.html > > And look what I read on Slashdot today: > > http://

Re: Suggestions for Submitting to CPAN

2004-01-18 Thread Tassilo von Parseval
On Sat, Jan 17, 2004 at 02:32:25PM -0500 Dan Anderson wrote: > I've read the tutorial on creating a Makefile.PL for a module I'm > submitting to CPAN, and I've applied for a PAUSE ID, but I was curious > if anyone whos been through the process before knows of any pit falls I > should be careful of,

Re: Creating My Own Escapes

2004-01-16 Thread Tassilo von Parseval
On Fri, Jan 16, 2004 at 03:38:40PM -0600 James Edward Gray II wrote: > I have a problem I just cant seem to get my head around, so any help is > appreciated. > > I have a string. It could contain anything a Perl string can contain. > I have to print this string to a file and later bring it ba

Re: Question about CPAN

2004-01-14 Thread Tassilo von Parseval
On Wed, Jan 14, 2004 at 03:05:20PM -0500 Hemond, Steve wrote: > I just used CPAN for the first time and everything is FINE. :-) > > After the initial configuration setup is done, it suggest me to install > Bundle::CPAN. > > First of all, what is that module? It is the very module you were using

Re: How to parse Microsoft Outlook Inbox

2004-01-08 Thread Tassilo von Parseval
On Thu, Jan 08, 2004 at 10:37:02PM -0500 Wiggins d'Anconia wrote: > PerlDiscuss - Perl Newsgroups and mailing lists wrote: > >Hi, > >I am trying to write a script that will parse Microsoft outlook Inbox > >to a .txt file. Please let me know if there a way to do that. Thanks in > >advance for

Re: Happy Birthday Perl

2003-12-18 Thread Tassilo von Parseval
On Thu, Dec 18, 2003 at 03:08:05PM +0530 Swaminathan Gopal wrote: > There are many interesting data about Perl in perlhist. For example, > > perldoc perlhist | perl -ne 'print if /larry.+\d+-\w+-\d+/i' | head -1 >Larry 1.000 1987-Dec-18 > > Happy Birthday Perl! > > Btw, how c

Re: First module!!! YAAAAY!!! :)

2003-12-11 Thread Tassilo von Parseval
On Thu, Dec 11, 2003 at 11:29:14AM -0800 drieux wrote: > > On Dec 11, 2003, at 10:28 AM, Tassilo von Parseval wrote: > [..] > > And since my attempts to get the specs for these META.yml failed, > >I am the more happy that the latest EU::MakeMaker creates it for me. > [..

Re: First module!!! YAAAAY!!! :)

2003-12-11 Thread Tassilo von Parseval
On Thu, Dec 11, 2003 at 09:32:18AM -0800 drieux wrote: > On Dec 10, 2003, at 11:35 PM, Tassilo von Parseval wrote: > >a decent META.yml is created and added to the distribution. > > I'm still working out if i really 'get it' > about the 'yml' trend.

Re: First module!!! YAAAAY!!! :)

2003-12-11 Thread Tassilo von Parseval
On Wed, Dec 10, 2003 at 02:26:40PM -0800 drieux wrote: > On Dec 10, 2003, at 4:39 AM, Ben Crane wrote: > > >Just sat done and put together my FIRST MODULE > It appears that perl5.8.1 rev of h2xs has some > minor changes: > [jeeves: 28:] h2xs -AX Wetware::Pid > Defaulting to backwards compati

Re: The True Path to Learning Perl Re: [OT] Education Level

2003-12-09 Thread Tassilo von Parseval
On Tue, Dec 09, 2003 at 01:43:06AM -0800 drieux wrote: > On Dec 9, 2003, at 1:24 AM, Tassilo von Parseval wrote: > [..] > >>hypothetical question, > >> > >>would one need to be a perl-porter > >>to write good perl? > [..] > > let us get s

Re: passing code inside function

2003-12-09 Thread Tassilo von Parseval
On Tue, Dec 09, 2003 at 09:14:52AM +0100 [EMAIL PROTECTED] wrote: > I would like to read something about passing code inside function. Lets say > that: > > This works: > perl -e 'sub a(&){print(&{$_[0]}, "/n"};$_=0; a {$_++} foreach 1..100' > > This don't work > perl -e 'sub a{print(&{$_[0]}, "/

Re: The True Path to Learning Perl Re: [OT] Education Level

2003-12-09 Thread Tassilo von Parseval
On Mon, Dec 08, 2003 at 11:33:08PM -0800 drieux wrote: > On Dec 8, 2003, at 2:50 PM, Tassilo von Parseval wrote: > [..] > >The current set of perl-porters that are able and willing > >to work on the core are with > >not many exceptions people with academic degrees.

Re: The True Path to Learning Perl Re: [OT] Education Level

2003-12-08 Thread Tassilo von Parseval
On Mon, Dec 08, 2003 at 12:43:37PM -0800 drieux wrote: > Learn to be nice to undergrads and grad students. > Think about the unpleasant lack of experience that > they have in a wide range of issues. Most of them > grew up in normal homes with median types of families. > ALL they have to 'validate

Re: Seeding a Random Number Generator

2003-12-07 Thread Tassilo von Parseval
On Sat, Dec 06, 2003 at 04:38:02PM -0800 John W. Krahn wrote: > Pd Schloss wrote: > > I'm reviewing a perl script that someone wrote to do a statistical > > analysis. I know it's bad form, but I was wondering if anyone knows > > what the default seed is for the random number generator in Perl.

Re: using perl in a c code

2003-12-04 Thread Tassilo von Parseval
On Wed, Dec 03, 2003 at 05:17:01PM -0600 Dan Muey wrote: > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also! In order to make your C code more portable across several versions of the perlapi, you could use Devel::PPPort. perl -MDevel::PPPort -eDevel::PPPort::WriteFile will create pp

Re: using perl in a c code

2003-12-03 Thread Tassilo von Parseval
On Wed, Dec 03, 2003 at 11:33:53AM -0600 Dan Muey wrote: > Ok, I can compile this example with: > cc -o perlemb perlemb.c `perl -MExtUtils::Embed -e ccopts -e ldopts` > > I can run it like this: > ./perlemb -e 'print "Howdy";' > Howdy > Or > ./perlemb > print "Howdy"; > > Howdy > > Here's wha

Re: using perl in a c code

2003-12-03 Thread Tassilo von Parseval
On Wed, Dec 03, 2003 at 09:35:54AM -0600 Dan Muey wrote: > > On Tue, Dec 02, 2003 at 05:40:14PM -0600 Dan Muey wrote: > > > > > What I was wondering about was how to execute some perl > > code *inside* > > > the c program instead of takign it via ARGV. I think eval_pv and > > > eval_sv have som

Re: using perl in a c code

2003-12-03 Thread Tassilo von Parseval
On Tue, Dec 02, 2003 at 05:40:14PM -0600 Dan Muey wrote: > What I was wondering about was how to execute some perl code *inside* > the c program instead of takign it via ARGV. I think eval_pv and > eval_sv have somethgin to do with it but I'm a bit cloudy there. > Since I don't know hardly anyth

Re: Encrypting PERL source code...

2003-12-01 Thread Tassilo von Parseval
On Mon, Dec 01, 2003 at 01:39:43PM -0500 [EMAIL PROTECTED] wrote: > Can anyone suggest where I might be able to find (hopefully a freeware > or shareware script..) a program that runs either on a windows system or > a PERL script that would "encrypt" a perl script by doing such things as > removin

Re: Where is editor that will Indent my perl code?

2003-11-03 Thread Tassilo von Parseval
On Mon, Nov 03, 2003 at 11:54:38AM -0800 Richard Heintze wrote: > Tim (or anyone else) > I have vim 6.1 and tried it out. I know VI (a little) > so I thought vim would not be so bad. I tried help and > searching help for indent and found it. It looks more > like a function call for their macro lan

Re: array of arrays

2003-10-20 Thread Tassilo von Parseval
On Mon, Oct 20, 2003 at 12:33:00PM +0200 Christiane Nerz wrote: > How do I read data out of a table-file in an array-of-arrays? > > Problem: I have to compare two tables with pairs of start-stop-Positions. > I want to find out, which pair of Start-Stop-Position in table_1 is > entirely within th

Re: Perl Vs ...

2003-09-22 Thread Tassilo von Parseval
On Sun, Sep 21, 2003 at 09:17:38PM -1000 Marc Adler wrote: > * Tassilo von Parseval <[EMAIL PROTECTED]> [2003-09-21 20:27]: > > I was always of the opinion that knowing C is one of the essential > > things. Too many vital stuff is nowadays hidden away from the user in >

Re: Perl Vs ...

2003-09-21 Thread Tassilo von Parseval
On Sun, Sep 21, 2003 at 09:28:21PM -0400 Paul Kraus wrote: > Perl was pretty much my first language. Not counting Business Basic and same > old Pascal from high school. The more I learn the more I see that perl can > handle just about anything I want to do. How do you go about deciding if you > sh

Re: using foreach on an array

2003-09-20 Thread Tassilo von Parseval
On Sat, Sep 20, 2003 at 03:56:14PM +0530 Ramprasad A Padmanabhan wrote: >I have a script in which I am using foreach in two diff ways > I am doing a last; in the very first loop So each time the variable $t > should be assigned only once. > > But you can see the results dont match. > > > #

Re: Random Number Question

2003-09-20 Thread Tassilo von Parseval
From: Anonymous <[EMAIL PROTECTED]> You are aware that the domain nospam.com is registered, aren't you? If you really don't want to give any email address, use example.com as domain (or any other, that truely doesn't exist). On Fri, Sep 19, 2003 at 09:08:13PM -0400 Anonymous wrote: > How do I get

Re:

2003-09-15 Thread Tassilo von Parseval
On Mon, Sep 15, 2003 at 06:25:29PM +1000 Vema Venkata wrote: > I had rewritten as per ur suggestions but > there is no prompt like this "choose Change_Request,call_req or Both?>#"; > > pls advise > > > > print "choose Change_Request,call_req or Both?>#"; > my$choose_table= ; #

Re: reset a file pointer

2003-09-05 Thread Tassilo von Parseval
On Fri, Sep 05, 2003 at 03:25:46PM +0530 Sachin Mathur wrote: > Hi , > I am a beginner in perl I would like to know how to reset a file > pointer in perl. Is their a rewind command in perl Yes, it's called seek(): use Fcntl qw/:seek/; seek FILE, 0, SEEK_SET; The first line is only for

Re: -w vs. use warnings

2003-08-28 Thread Tassilo von Parseval
On Thu, Aug 28, 2003 at 04:17:21PM -0400 K Old wrote: > Having been a Perl programmer for several years now I have become > accustom to using the following as my normal "start" of any Perl script: > > #!/usr/bin/perl > use warnings; > use strict; > > Randal Schwartz uses this: > > #!/usr/bi

Re: DynaLoader with nonstandard lib location

2003-08-28 Thread Tassilo von Parseval
On Wed, Aug 27, 2003 at 06:00:40PM -0700 Reid Beels wrote: > I'm trying to install a module (Image::Imlib2) which depends on > DynaLoader being able to find an external C library. Normally, this > wouldn't cause a problem but I'm being forced to install the module on > a system which I do n

Re: Full path to the perl intrepter

2003-08-26 Thread Tassilo von Parseval
On Tue, Aug 26, 2003 at 04:12:59PM +0200 [EMAIL PROTECTED] wrote: > I'm in a very old project and my scripts are calling other scripts. I have 3 > or 4 different perl version in the server. I need to call the sub-scripts > with the some version of perl that I'm using in the caller script. > > How

Re: beginner trying to parse a piece of mail

2003-08-26 Thread Tassilo von Parseval
On Mon, Aug 25, 2003 at 05:19:14PM -0700 nntp.perl.org wrote: > I have had success now using Mail::MboxParser for all my basic mail parsing > needs, like getting subject, from, to. Now bossman wants me to do more > extensive regex filtering and grabbing weird data in the email body. > > I wrote

Re: Benchmark times

2003-08-24 Thread Tassilo von Parseval
On Sun, Aug 24, 2003 at 09:35:39AM +0200 Janek Schleicher wrote: > Pablo Fischer wrote at Sun, 24 Aug 2003 01:45:42 +: > > Exists a website with benckmark running times in Perl? > > http://www.google.com/search?q=benchmark+perl+programming+languages Benchmark between languages are - at the b

Re: hex2Bin

2003-08-18 Thread Tassilo von Parseval
On Mon, Aug 18, 2003 at 07:34:41AM -0400 Kipp, James wrote: > > I have a file cointaing 1024 hex numbers . > > I want to convert them to Bin. > > Please help > > try something like this: > > $hex = 0xff; > $bin = unpack("B32", pack("N", hex $hex)); The above assumes big-endian byteorder. For

Re: Please don't say RTFM

2003-08-16 Thread Tassilo von Parseval
On Fri, Aug 15, 2003 at 11:44:04PM -0600 Robert Mark White wrote: > Please be gentle with me as this is only my first day trying to learn perl. > I am using an online tutorial, however it must be written for *nix and I am > trying to use it on win32. > man perl does not even work. We'll come to t

Re: Look Ahead

2003-08-14 Thread Tassilo von Parseval
On Wed, Aug 06, 2003 at 07:02:21PM -0700 Gupta, Sharad wrote: > I have a path like: > > $s = "http::/foo/bar:http::/foo1/bar1:http/foo1/bar1"; > > I am trying to get all the http paths which are seperated by ":" like this: > > @x = ($s =~ /(http::.*?):(?=http::.*?)/g) > > The problem is i get

Re: Sick of installing CPAN modules

2003-08-14 Thread Tassilo von Parseval
On Thu, Aug 07, 2003 at 11:05:19AM -0700 jc wrote: > I have parse a mailbox in order to grab data from each email. Simple enough > right? > > So I tried to use the CPAN module Mail::MboxParser (0.17 version because the > new one requires more modules than this one) I installed the prerequisite >

Re: data recovery ext3 (was RE: Recover zip file via Archive::Zip)

2003-08-14 Thread Tassilo von Parseval
On Thu, Aug 07, 2003 at 03:09:06PM -0400 West, William M wrote: > >While I'm still off topic and speaking of data recovery, has anyone > >every recovered data from a ext3 filesystem after all utilities have > >been tried to repair them? I've tried all the utilities off of > >freshmeat.net and not

Re: Questions of OOP in Perl

2003-08-14 Thread Tassilo von Parseval
On Fri, Aug 08, 2003 at 12:05:47AM + Pablo Fischer wrote: > I have some questions about OOP in Perl. > > 1. In my class I have lot of methods, but some of them just parse a file or > pass a string to a different format (like in C, Im thinking that they are > private), In perl, whats the bet

Re: CGI text process question

2003-08-11 Thread Tassilo von Parseval
On Wed, Aug 06, 2003 at 11:13:15PM -0500 Ben Jacobs-Swearingen wrote: > Hello all, this is my first post to this group, and I hope it isn¹t > inappropriate. Anyway I have the following code in a CGI I¹m working on, > it¹s supposed to translate the ugly %(hexhex) markers for non-alphanumeric > char

Re: Initializing code in a module...

2003-07-14 Thread Tassilo von Parseval
On Mon, Jul 14, 2003 at 11:41:40AM +0200 Hamish Whittal wrote: > Anyone know whether or how I can initialise code when calling any of the > subroutines within a module? > I don't necessarily want to call the module personally, I would like it > to be called when I call any of the subroutines. You

Re: Being a moron CGI.pm

2003-07-12 Thread Tassilo von Parseval
On Fri, Jul 11, 2003 at 11:53:55PM -0700 Rus Foster wrote: > I know what I'm about to ask is a really stupid question but I just can't > get my head around my first outing with CGI.pm. I've RTFM as appropiate > but getting nowhere. All I want to do is dump a list of variable and their > values whi

Re: scandir

2003-07-06 Thread Tassilo von Parseval
On Sun, Jul 06, 2003 at 02:43:14PM +0530 Pandey Rajeev-A19514 wrote: > Do we have a perl function equivalent with the same functionality as > the function "scandir" in c language ? No, we don't. Simply do it yourself: my $dir = "/path"; opendir DIR, $dir or die $!; my @list = sort {

Re: Use Carp in package

2003-06-24 Thread Tassilo von Parseval
On Tue, Jun 24, 2003 at 01:52:20PM -0500 Dan Muey wrote: > I'm writing a simple module to return a few variables and functions. > > The perldoc perlmod* stuff says I should use Carp; and call that > instead of warn(). > So.. > 1) > If I use Carp shoud I still use warnings; in the package? Those

Re: Passing control to another perl program....

2003-06-23 Thread Tassilo von Parseval
On Mon, Jun 23, 2003 at 10:04:22PM +0200 Hamish Whittal wrote: > I have this scenario: > I have a 'main' program that needs to call on progA under condtions A, > progB under conditions B, etc. > > Now, I would like the progA, progB, progC to remain independent of the > 'main' program at all times

Re: Please help... struggling beginner.

2003-06-23 Thread Tassilo von Parseval
On Mon, Jun 23, 2003 at 10:43:07AM +0200 Denham Eva wrote: > I am very much a novice at perl and probably bitten off more than I can chew > here. > I have a file, which is a dump of a database - so it is a fixed file format. > The problem is that I am struggling to manipulate it correctly. I have

Re: longmess_heavy subroutine undefined -- solved

2003-06-21 Thread Tassilo von Parseval
[ CCed to [EMAIL PROTECTED] ] On Sat, Jun 21, 2003 at 03:20:59PM -0700 Rob Richardson wrote: > I found out where the problem was, but not why it happened. It occured > to me that it might be a good idea to compile each of the module files > my program uses individually. One of them had a missin

Re: longmess_heavy subroutine undefined

2003-06-20 Thread Tassilo von Parseval
On Fri, Jun 20, 2003 at 01:16:51PM -0700 Rob Richardson wrote: > Greetings! Hi there, > I think something is corrupted. I am suddently getting error messages > saying that the undefined subroutine longmess_heavy is used in file > carp.pm. My search path seems to have gotten screwed up. Any > s

Re: Accessing C/C++ Dlls using perl

2003-06-19 Thread Tassilo von Parseval
On Thu, Jun 19, 2003 at 01:42:29PM -0400 zentara wrote: > On Thu, 19 Jun 2003 01:37:09 -0700 (PDT), [EMAIL PROTECTED] (Ben Crane) > wrote: > >Thanx, I hunting the info down now, seems quite > >complex. I'm wondering whether it might not be better > >to have a crack at this in C? Have you found pe

Re: Accessing C/C++ Dlls using perl

2003-06-19 Thread Tassilo von Parseval
On Thu, Jun 19, 2003 at 01:37:09AM -0700 Ben Crane wrote: > Thanx, I hunting the info down now, seems quite > complex. I'm wondering whether it might not be better > to have a crack at this in C? The difference between doing XS in C and in C++ isn't all that rough. See "Using XS With C++" in per

Re: Tassilo's email signature

2003-06-18 Thread Tassilo von Parseval
On Wed, Jun 18, 2003 at 04:08:22PM +0100 AustinTanney wrote: > Hi I'm totally new to the list and havent a clue about coding. gotta start > somewhere tho :-) > > Interesting signature. One thing I dont get though is, why when i change any > of the backwards text does it stop the output from worki

Re: Tassilo's email signature

2003-06-18 Thread Tassilo von Parseval
[ CCed to [EMAIL PROTECTED] ] On Wed, Jun 18, 2003 at 06:43:24AM -0700 Rob Richardson wrote: > Interesting! Not that I can understand much of it... > > But I'm particularly interested in the caller stack. Is that standard > Perl or do I have to have a special module? caller() is a Perl-builti

Re: Tassilo's email signature

2003-06-18 Thread Tassilo von Parseval
On Wed, Jun 18, 2003 at 09:44:58AM +0100 Sparrow, Dave wrote: > A regular contributor to the Perl Quiz Of The Week discussion newsgroup > ([EMAIL PROTECTED]) is Tassilo von Parseval. Actually even more regularly to this list here so I can respond... > His email signature is reproduced

Re: Info req

2003-06-17 Thread Tassilo von Parseval
On Wed, Jun 18, 2003 at 12:38:35AM -0400 Shishir K. Singh wrote: > I am trying to locate the perl code for the opcode -B or stat but I > am getting lost in the maze of all the files. Would appreciate it if > someone could pls direct me to the actual file where the algo for -B > file test switch

Re: %x = ( xyx => 'abc' ) is strange!

2003-06-17 Thread Tassilo von Parseval
On Mon, Jun 16, 2003 at 10:03:50PM -0700 Richard Heintze wrote: > Why does this program print "yes def" but not "yes > xyz"? It does print "xyz:def", so I don't understand > why it does not print "yes xyz". > > { > my %x = ( xyx => 'abc', d => 'y', f => 'g' ); ^^^ > $x{"def"} =

Re: Style ( was:Capture a printing function into an array )

2003-06-17 Thread Tassilo von Parseval
On Mon, Jun 16, 2003 at 11:39:30PM -0700 Harry Putnam wrote: > "Charles K. Clarkson" <[EMAIL PROTECTED]> writes: > > > > > $$line =~ s/[Ss]ource/Src/g; > > $$line =~ s/[Dd]estination/Dst/g; > > $$line =~ /^[^ ]+, (\d[^ ]+ \d[^ ]+).*(Src[^ ]+ \d+).*(Dst[^ ]+ > > Where do I

Re: Strings and operators?

2003-06-14 Thread Tassilo von Parseval
On Sat, Jun 14, 2003 at 08:56:21AM -0500 deborah wrote: > How does Perl interpret a string when used in a numeric comparison > equation? It depends. > I accidently used a numeric comparison operator when I was comparing > strings and I found that no matter what strings I compared, Perl always

Re: Find regex in Start/Stop segments

2003-06-13 Thread Tassilo von Parseval
On Fri, Jun 13, 2003 at 03:09:20PM -0700 R. Joseph Newton wrote: > Tassilo von Parseval wrote: > > > > chomp; > > > > I don't think that the entries in @ARGV contain newlines at the end. > > Actually I know they don't. :-) > > > > That&#x

Re: Find regex in Start/Stop segments

2003-06-11 Thread Tassilo von Parseval
On Tue, Jun 10, 2003 at 11:49:25PM -0700 Harry Putnam wrote: > I use a homeboy data base technique to keep info about the scripts I > write and other typse of stuff too. Here I'm just dealing with > scripts. > > Its a simple format to enter key information about what a script > does. Looks like

Re: How can I find the module version?

2003-06-10 Thread Tassilo von Parseval
On Tue, Jun 10, 2003 at 09:32:53AM -0400 Rick Ressegger wrote: > If I want to know what version of a module is already installed on a system, > how can I disclose this? Either use Janek's suggestion or ask for the value of $VERSION for the module in question: perl -MSome::Module -e 'warn Som

Re: replacing text in a file

2003-06-09 Thread Tassilo von Parseval
On Mon, Jun 09, 2003 at 03:22:52PM +0100 Rob Dixon wrote: > Tassilo Von Parseval wrote: > > You can use the same underlying technique from within a Perl script. You > > have to set two special variables accordingly and Perl can even do an > > inplace-edit: >

Re: replacing parts of a string

2003-06-09 Thread Tassilo von Parseval
On Mon, Jun 09, 2003 at 04:53:53AM -0500 christopher j bottaro wrote: > i want to do something like: > $line =~ s/M (\d+) (\d+)/M $1+100 $2+200/; > obviously adding 100 to $1 and 200 to $2, not adding the text '+100' and > '+200'. Use the /e modifier and turn the substitution side into a valid P

Re: replacing text in a file

2003-06-09 Thread Tassilo von Parseval
On Mon, Jun 09, 2003 at 02:46:48AM -0500 christopher j bottaro wrote: > what is the easiest way to replace text in a file? say i have file blah.txt > and i want to replace some regular expression found in that file with > something. also, i want to do this from within the perl program, not by

Re: how to count?

2003-06-09 Thread Tassilo von Parseval
On Sun, Jun 08, 2003 at 11:41:26PM -0500 Jerry Preston wrote: > I am not sure if this can be done or not, but I want to create a counter on > the fly so to speak. > > foreach $id ( @IDS ) { > $cnt = "$id"."_cnt"; > $cnt++; > } > > All I get is "item_cnt". Is there a way

Re: perl extensions

2003-06-07 Thread Tassilo von Parseval
On Fri, Jun 06, 2003 at 10:33:21PM -0700 R. Joseph Newton wrote: > Francis Henry wrote: > > The following is a note from a colleague of which I am skeptical: > > > > "fyi > > .pl used to be used for both executables and libraries. > > A library is simply perl code located in a differe

Re: Flush Everything

2003-06-05 Thread Tassilo von Parseval
On Fri, Jun 06, 2003 at 04:12:11PM +1200 Voodoo Raja wrote: > I have got a script running.. > > Its ment to repeat a particular sub routine using the "after" syntax What is the "after" syntax? Do you mean statement-modifiers as in function() for 1 .. 10; ? > All i want to do is clear ev

Re: Warnings/strict still needed?

2003-06-05 Thread Tassilo von Parseval
On Wed, Jun 04, 2003 at 03:58:44PM -0500 James Edward Gray II wrote: > On Wednesday, June 4, 2003, at 03:45 PM, John W. Krahn wrote: > > >>Does it hurt performance having them? > > > >No. > > Are we sure about this? I find it really hard to believe that > 'warnings' isn't affecting performance

Re: More Jump Shots ;-) [Was Re: arrays and hashes]

2003-06-04 Thread Tassilo von Parseval
On Tue, Jun 03, 2003 at 08:36:05PM +0200 Kevin Pfeiffer wrote: > Since it seemed like a nice exercise to work on I played with this some > myself. Goals being to try to avoid global variables, use subroutines and > keep MAIN 'uncluttered' and pass arguments to subs as needed. > > I think I did

Re: converting arrayname to string or vice-versa

2003-06-02 Thread Tassilo von Parseval
On Mon, Jun 02, 2003 at 07:53:06AM -0400 zentara wrote: > This one is puzzling me. > I know it's in the faq, to not use variables for variable naming, > but I find it odd that I can't get a "stringified" form of a variable > name, maybe from the symbol table? Or from the B line of modules? > > S

Re: Passing arrays/associative arrays into subroutines ... how?

2003-06-02 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 04:20:28PM -0500 James Edward Gray II wrote: > On Sunday, June 1, 2003, at 04:12 PM, Ken Tozier wrote: > > >No luck. Dropping the \ in 'my $description = > >DescribeCritter(\%wombatStats);' didn't fix the problem. > > You're right. I was dumb. Let me try again... > >

Re: using a CONSTANT as a pathname

2003-06-02 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 08:36:34PM -0400 Todd Wade wrote: > "Tassilo Von Parseval" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] > > On Sun, Jun 01, 2003 at 11:22:32AM +0200 Kevin Pfeiffer wrote: > > > > > > > open DATA, &

Re: open(IN,) flock?

2003-06-02 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 09:35:56AM -0700 Bob's Demise wrote: > I've written a Perl/CGI that allows a user to search > for a string in a specified file. I've yet to make > this little program widely available - and currently > with one or two users - it's quite speedy. I > anticipate no more than

Re: using a CONSTANT as a pathname

2003-06-01 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 01:13:31PM +0200 Kevin Pfeiffer wrote: > Hi Tassilo, Hi there, > In article <[EMAIL PROTECTED]>, Tassilo Von Parseval wrote: > > if your Perl is recent enough (>= 5.6.0). Or you use the > > interpolate-anything trick: > > > &

Re: using a CONSTANT as a pathname

2003-06-01 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 11:22:32AM +0200 Kevin Pfeiffer wrote: > More problems trying to use constants... > > I have: > > use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; > > > But I can't see how to make this work: > > open DATA, "> CFG" or die "Couldn't open ", CFG, " for writing: $!\n"; >

Re: Perl Text to Wav

2003-06-01 Thread Tassilo von Parseval
On Sat, May 31, 2003 at 11:51:59AM -0400 Jan van den Berg wrote: > I was wondering if some of you might have come across a free module/ > program with which it is possible to do to text to wav conversion. > > I've been looking at this for some time, but I don't seem to get > anywhere. > > What I

Re: variable not being interpreted

2003-05-31 Thread Tassilo von Parseval
On Sat, May 31, 2003 at 10:30:02AM +0200 Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, Tassilo Von Parseval wrote: > > > On Sat, May 31, 2003 at 01:50:51AM +0200 Kevin Pfeiffer wrote: > > > >> I use a function to return a value: > >> "

Re: variable not being interpreted

2003-05-31 Thread Tassilo von Parseval
On Sat, May 31, 2003 at 01:50:51AM +0200 Kevin Pfeiffer wrote: > I use a function to return a value: > "$ENV{HOME}/perl/qotw/qotw13/mb"; which is then assigned to $mb > > But the $ENV{HOME} part is not being interpreted, so this sample: > > my $mb = get_config('mb', '.get_quiz'); > prin

Re: MySQL and perl using quotes

2003-05-29 Thread Tassilo von Parseval
On Thu, May 29, 2003 at 11:17:40AM +0200 anthony wrote: > i have to update a MySQL tables some names and text > the problem is that the names and words have quotes > maybe in names it has O'connor, and text would be > He said :"I'don't know where to go!!". > > where there is a mixture of single

Re: global variable

2003-05-28 Thread Tassilo von Parseval
On Wed, May 28, 2003 at 12:05:41PM +0200 anthony wrote: > i have a script with my modules. > i.e > #!/usr/bin/perl > use strict; > use warnings; > use Config::IniFiles; > my $cfg = new Config::IniFiles( -file => "/path/configfile.ini" ); > use lib '/path/tomy/Module'; > use MyModule; > use TestMod

Re: catch errors

2003-05-27 Thread Tassilo von Parseval
On Tue, May 27, 2003 at 02:27:29PM -0400 Moshe wrote: > How do I catch/handle runtime errors in Perl? > > Something like: > > try { > > } catch (e) {} > > or Use a block eval: eval { # potentially failing code }; if ($@) { print "An error occured: $@"; } $@ i

Re: GetOpt Help

2003-05-27 Thread Tassilo von Parseval
On Tue, May 27, 2003 at 12:12:12PM -0400 Paul Kraus wrote: > Reading through the doc's it says that it is preferred that you write > the -h help info using POD. Which docs state that? > How is this down? Any links on how to write > pod or have a perl script display pod for built in help. Pod::U