Re: trouble with writing to file

2004-03-03 Thread Jan Eden
incognito wrote: >Thank you for your attention, Bob. > >>What is your actual regex? At a minimum, you'll need /g modifier. >>You may need /m and/or /s as well. > >May be I didn't explained my prob exactly. I don't have a problem >with the regex (and yes, I have the /m /g and /s). Related to the >

Re: trouble with writing to file

2004-03-01 Thread david
Wc -Sx- Jones wrote: [snip] > > my $file = "20040301-www.tgz"; > [snip] > > But I have a question - > > Does even mentioning (?:) usage break capturing? > > I get undefined errors when trying: > > $file =~ /^(\d+)-www.t(?:ar.)gz/i; > print $1; no. it won't break capturing. you get undef

Re: trouble with writing to file

2004-03-01 Thread WC -Sx- Jones
Owen wrote: On Mon, 1 Mar 2004 18:08:08 +0100 incognito <[EMAIL PROTECTED]> wrote: open(FH, "> $pkg_filename") or die "could not create $pkg_filename"; while ($input =~ m/.../) { print $1; FH->print("$1\n") or die "could not write to $pkg_filename"; } I would have thought that to g

Re: trouble with writing to file

2004-03-01 Thread incognito
Thank you Bob and Owen. [Bob] > I notice you don't put an explicit path on the filename. Is it possible the > current directory is something other that what you expect it to be, and the > file is being successfully created in another location? I thought about that and so I tried an absolute path

Re: trouble with writing to file

2004-03-01 Thread Owen
On Mon, 1 Mar 2004 18:08:08 +0100 incognito <[EMAIL PROTECTED]> wrote: > open(FH, "> $pkg_filename") or die "could not create $pkg_filename"; > while ($input =~ m/.../) { > print $1; > FH->print("$1\n") or die "could not write to $pkg_filename"; > } I would have thought that to ge

RE: trouble with writing to file

2004-03-01 Thread Bob Showalter
incognito wrote: > Thank you for your attention, Bob. > > > What is your actual regex? At a minimum, you'll need /g modifier. > > You may need /m and/or /s as well. > > May be I didn't explained my prob exactly. > I don't have a problem with the regex (and yes, I have the /m /g and > /s). Related

Re: trouble with writing to file

2004-03-01 Thread incognito
Thank you for your attention, Bob. > What is your actual regex? At a minimum, you'll need /g modifier. You may > need /m and/or /s as well. May be I didn't explained my prob exactly. I don't have a problem with the regex (and yes, I have the /m /g and /s). Related to the regex, my script works fi

RE: trouble with writing to file

2004-03-01 Thread Bob Showalter
Reinhard Mantey wrote: > undef $/; > my $input = <>; > my $pkg_filename = "longnames.txt"; > > open(FH, "> $pkg_filename") or die "could not create $pkg_filename"; > while ($input =~ m/.../) { What is your actual regex? At a minimum, you'll need /g modifier. You may need /m and/or /s as well.

trouble with writing to file

2004-03-01 Thread Reinhard Mantey
Hello, I came to perl by J.Friedl's regex-book without any perl-experiences. I wrote a little script to scan packages and their dependencies from a book (lfs). The script works fine and I get the packages with their dependencies. Now I tried to expand that script that way, that I wanted to write

trouble with writing to file

2004-03-01 Thread incognito
Hello, I came to perl by J.Friedl's regex-book without any perl-experiences. I wrote a little script to scan packages and their dependencies from a book (lfs). The script works fine and I get the packages with their dependencies. Now I tried to expand that script that way, that I wanted to write