in reply to Re: Re: Shell v Perl
in thread Shell v Perl, here-doc as stdin

That brings up a good question. Would you be able to use regexp in a situation like that?

$buffer = <<"/\s*END/";

I don't have perl here at work, so I can't test it.

--Coplan

Replies are listed 'Best First'.
Re: Re: Re: Re: Shell v Perl
by Tomte (Priest) on Apr 11, 2003 at 08:01 UTC

    Short answer: No:

    #!/usr/bin/env perl eval { sub test { my $buffer =<<"/\s*END/"; Eins Zwei END return $buffer; } print test(); }; if($@) { print $@; } print "\ndone\n"; __END__ Can't find string terminator "/\s*END/" anywhere before EOF at test.pl + line 3.

    Longer answer in perlfaq4 as answer to the question "Why don't my <<HERE documents work?".

    regards,
    tomte


    Hlade's Law:

    If you have a difficult task, give it to a lazy person --
    they will find an easier way to do it.


    Corrcted the code to look like zthe code I actually used ;)