/ Forside / Teknologi / Udvikling / Perl / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Perl
#NavnPoint
bjarneA 141
poul_from 50
soccer 30
Nicknack 14
Tmpj 0
udkommentere blokke i script
Fra : Lars Eckberg


Dato : 27-08-02 15:22

hej,

kan man bruge

=begin comment

yadda
yadda
....
....

=end comment

i et perlscript, som _ikke_ er et modul..??
Mit script opfører sig mærkeligt, når jeg udkommenterer blokke på denne
måde.. :(

Mvh Lars



 
 
Lars Balker Rasmusse~ (27-08-2002)
Kommentar
Fra : Lars Balker Rasmusse~


Dato : 27-08-02 18:18

"Lars Eckberg" <funky@worldonline.dk> writes:
> kan man bruge
>
> =begin comment
>
> yadda
> yadda
> ...
> ...
>
> =end comment
>
> i et perlscript, som _ikke_ er et modul..??
> Mit script opfører sig mærkeligt, når jeg udkommenterer blokke på denne
> måde.. :(

perlfaq7:
How can I comment out a large block of perl code?

Use embedded POD to discard it:

# program is here

=for nobody
This paragraph is commented out

# program continues

=begin comment text

all of this stuff

here will be ignored
by everyone

=end comment text

=cut

This can't go just anywhere. You have to put a pod
directive where the parser is expecting a new statement, not
just in the middle of an expression or some other arbitrary
yacc grammar production.

Du skal altså huske et =cut efter hver comment-block.
--
Lars Balker Rasmussen                  "S.M.R.T."

Lars Eckberg (28-08-2002)
Kommentar
Fra : Lars Eckberg


Dato : 28-08-02 07:51


"Lars Balker Rasmussen" <lars@balker.org> wrote in message
news:0fsn10qkzh.fsf@laphroaig.balker.org...
> =end comment text
>
> =cut
>
> This can't go just anywhere. You have to put a pod
> directive where the parser is expecting a new statement, not
> just in the middle of an expression or some other arbitrary
> yacc grammar production.
>
> Du skal altså huske et =cut efter hver comment-block.

Ahhh... Jeg havde ikke forstået at jeg skulle bruge =cut for at komme
"tilbage".
Mange tak!

-- Lars
> --
> Lars Balker Rasmussen "S.M.R.T."



Søg
Reklame
Statistik
Spørgsmål : 177435
Tips : 31962
Nyheder : 719565
Indlæg : 6408016
Brugere : 218879

Månedens bedste
Årets bedste
Sidste års bedste