Please take any further messages in this conversation off list. It's
off-topic, off-putting to newcomers, and generally boring and/or
aggravating for those of us that have seen it before.
Rob: there is no obligation for people to disclose that they wrote the
stuff they're advocating. Nobody has a
On 10/05/2013 04:54 AM, Rob Dixon wrote:
Uri, I rarely see File::Slurp recommended other than by yourself.
usually it is in the context of a work-around for Perl's lack of support
for a regex version of $/. I have also never had occasion to use it
myself, despite a working understanding of its
On 04 Oct 2013 06:33, Shlomi Fish wrote:
> On 02 Oct 2013 Uri Guttman wrote:
>> On 02 Oct 2013 08:56 PM, Rob Dixon wrote:
>>> On 03 Oct 2013 01:39, Uri Guttman wrote:
I do recommend you try to use File::Slurp to read in and write out your
files.
>>>
>>> It would help a lot if you dec
Hi Uri,
On Wed, 02 Oct 2013 23:44:04 -0400
Uri Guttman wrote:
> On 10/02/2013 08:56 PM, Rob Dixon wrote:
> > On 03/10/2013 01:39, Uri Guttman wrote:
> >>
> >> I do recommend you try to use File::Slurp to read in and write out your
> >> files.
> >
> > It would help a lot if you declared your inte
On Wed, Oct 2, 2013 at 5:10 PM, Peter Holsberg
wrote:
> Charles DeRykus has written on 10/2/2013 5:49 PM:
> >
> > Wouldn't a manual edit be easier... or is this a recurrent problem?
> > If recurrent, a messy solution may be possible but fragile unless
> > the html formatting is invariant - what if
Shawn H Corey wrote:
On Wed, 02 Oct 2013 13:57:36 -0400
Peter Holsberg wrote:
I was so upset that I deleted it all! It seems to me that
it should be fairly straightforward, but at 79, the old synapses
aren't firing quite as well as they used to.
Can you get me started?
Sure:
my @files =
Peter Holsberg wrote:
Let me start over.
The file I want to modify has a 6-digit filename and an extension htm.
For example, 131002.htm
I'm working in Windows, with Strawberry perl, with Randall L. Schwartz's
Randal L. Schwartz
John
--
Any intelligent fool can make things bigger and
more
On 10/02/2013 08:56 PM, Rob Dixon wrote:
On 03/10/2013 01:39, Uri Guttman wrote:
I do recommend you try to use File::Slurp to read in and write out your
files.
It would help a lot if you declared your interest in File::Slurp. It is
disingenuous to recommend your own modules.
i don't see why
On 10/02/2013 08:44 PM, Peter Holsberg wrote:
Uri Guttman has written on 10/2/2013 8:39 PM:
use File::Slurp qw( read_dir edit_file ) ;
foreach my $file ( grep /^\d{6}\.htm$/, read_dir( $dir ) ) {
edit_file { s/foo/bar/g } $file ;
}
read_dir is also fr
That should read as follows:
use strict;
use warnings;
use Tie::File;
use File::Copy 'copy';
use File::Spec;
my $dir = '/path/to/my/directory';
opendir my ($dh), $dir;
# Find all files in the directory that match \d{6}\.htm
# Die if none or multiple files found
#
my @files = grep /\A\d{6}\
On 02/10/2013 18:22, Peter Holsberg wrote:
Hi,
I have tried to do this for hours but it looks like it is just too
difficult for me.
I would like a script to open a file in the current directory and edit
it. The file's name is \d{6}.htm
The script then needs to search for a line that begins:
On 03/10/2013 01:39, Uri Guttman wrote:
I do recommend you try to use File::Slurp to read in and write out your
files.
It would help a lot if you declared your interest in File::Slurp. It is
disingenuous to recommend your own modules.
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@pe
On 03/10/2013 00:19, Shawn H Corey wrote:
It would be difficult to get a file with a backslash in it.
perl -e "open X, q/>\d{6}.htm/"
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Uri Guttman has written on 10/2/2013 8:39 PM:
> On 10/02/2013 08:02 PM, Peter Holsberg wrote:
>> Let me start over.
>>
>> The file I want to modify has a 6-digit filename and an extension htm.
>> For example, 131002.htm
>
> i figured that was the case. you should state that in the beginning and
On 10/02/2013 08:02 PM, Peter Holsberg wrote:
Let me start over.
The file I want to modify has a 6-digit filename and an extension htm.
For example, 131002.htm
i figured that was the case. you should state that in the beginning and
then say a regex to match that is \d{6}\.htm. then you can u
On 10/02/2013 07:19 PM, Shawn H Corey wrote:
On Wed, 02 Oct 2013 23:43:40 +0100
Rob Dixon wrote:
The file's name is \d{6}.htm
do you mean that literal name, or do you want to include *.htm files
that start with six decimal digits? Jim Gibson has assumed the former,
while Shawn, the latter.
Let me start over.
The file I want to modify has a 6-digit filename and an extension htm.
For example, 131002.htm
I'm working in Windows, with Strawberry perl, with Randall L. Schwartz's
"Learning Perl", copyright 1993. I also have "Perl 5 Pocket Reference",
1998 and copies of "Programming Perl"
On Wed, Oct 2, 2013 at 8:19 PM, Shawn H Corey wrote:
> On Wed, 02 Oct 2013 23:43:40 +0100
> Rob Dixon wrote:
>
> > > The file's name is \d{6}.htm
> >
> > do you mean that literal name, or do you want to include *.htm files
> > that start with six decimal digits? Jim Gibson has assumed the former
On Wed, 02 Oct 2013 23:43:40 +0100
Rob Dixon wrote:
> > The file's name is \d{6}.htm
>
> do you mean that literal name, or do you want to include *.htm files
> that start with six decimal digits? Jim Gibson has assumed the former,
> while Shawn, the latter.
It would be difficult to get a file
On Wed, Oct 2, 2013 at 4:44 PM, Peter Holsberg
wrote:
> Shawn H Corey has written on 10/2/2013 2:29 PM:
> > On Wed, 02 Oct 2013 13:57:36 -0400
> > Peter Holsberg wrote:
> >
> >> I was so upset that I deleted it all! It seems to me that
> >> it should be fairly straightforward, but at 79, the old
On 02/10/2013 20:44, Peter Holsberg wrote:
Shawn H Corey has written on 10/2/2013 2:29 PM:
my @files = grep { /^\d{6}\.htm$/i } glob( '*.htm' );
Well, I'm more of a beginner than I thought I was!
The /i to grep is to ignore case?
Why are you globbing *.htm?
Hi Peter
All that Shawn has sh
On Wed, 02 Oct 2013 15:44:56 -0400
Peter Holsberg wrote:
> Why are you globbing *.htm?
See `perldoc -f glob` and `perldoc File::Glob`.
--
Don't stop where the ink does.
Shawn
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@pe
On Oct 2, 2013, at 10:22 AM, Peter Holsberg wrote:
> Hi,
>
> I have tried to do this for hours but it looks like it is just too
> difficult for me.
>
> I would like a script to open a file in the current directory and edit
> it. The file's name is \d{6}.htm
That is an unusual name for a file.
Shawn H Corey has written on 10/2/2013 2:29 PM:
> On Wed, 02 Oct 2013 13:57:36 -0400
> Peter Holsberg wrote:
>
>> I was so upset that I deleted it all! It seems to me that
>> it should be fairly straightforward, but at 79, the old synapses
>> aren't firing quite as well as they used to.
>>
>> C
On Wed, 02 Oct 2013 13:57:36 -0400
Peter Holsberg wrote:
> I was so upset that I deleted it all! It seems to me that
> it should be fairly straightforward, but at 79, the old synapses
> aren't firing quite as well as they used to.
>
> Can you get me started?
Sure:
my @files = grep { /^\d{6}\.
John SJ Anderson has written on 10/2/2013 1:45 PM:
> On Wed, Oct 2, 2013 at 10:22 AM, Peter Holsberg
> wrote:
>> Hi,
>>
>> I have tried to do this for hours but it looks like it is just too
>> difficult for me.
>
> You should maybe show the code you have, and we can help you with
> that. If you'v
On Wed, Oct 2, 2013 at 10:22 AM, Peter Holsberg
wrote:
> Hi,
>
> I have tried to do this for hours but it looks like it is just too
> difficult for me.
You should maybe show the code you have, and we can help you with
that. If you've worked for "hours", you must have something to show.
j.
--
T
27 matches
Mail list logo