Hello Derek Am Montag, 7. März 2005 02.04 schrieb [EMAIL PROTECTED]:
> greetings. > > cool beans! What perldoc has ###- -### in it? > ...marked with...? for me is not enough of an explanation. sorry. Sorry, i was just confused. The '#' sign is (at least most of the time) a comment character; everything between '#' and the line end (including the '#') is a comment, ignored by perl. (sorry, I don't know where it's documented) One can comment code with it, e.g. :> /^\s+(\d+)$/ and $total += $1; # $total only changed if regex match I used it to mark a code line, to refer to it afterwards in the text, e.g. :> /^\s+(\d+)$/ and $total += $1; ###--### :> :> bla bla an look at the lines marked with ###--### bla bla... or to comment out code lines (instead of deleting it), or even both (commenting out and marking at the same time to later refer to it in some text, e.g. :> while (<OLD>) { :> :> #*# $_=~s{\[\d+/\d+/\d+\s\d+:\d+\]\s}{}; :> $_=~s{delete}{}; :> :> #*# print NEW $_ if $_ !~ /^<.*>/; :> print NEW $_ if $_ !~ /^A/; :> :> } :> :> :> bla bla bla and I replaced your lines (marked with #*#) by a :> simpler version bla bla... (the lines marked with #*# are not executed because they are a commented out, means: are a comment for perl) I could have used something like "#%%marked%%" instead of "##--##" of course. =*= There are cases where '#' is not a comment but taken literaly, e.g. in the regex :> /looking for a literal # in this string/ or in :> my $string=q#this is a string#; (although it's possible to have (spaces and) '#' as comment in regexes with the modifier /x, see perldoc perlre, as e.g. in :> /this :> is a multiline # this is a comment within the regex :> regex with comments :> /x; meaning the same as :> /thisisamultilineregexwithcomments/ ) > yes as I read in programming perl as well lead me to this solution. On pg. > 93 it states > > " =~ binds a string expression to a pattern match, substitution, or > translation. These operations would otherwise search or modify the string > contained in $_. The string you want to bind is on the left while the > operator is put on the right. The return value indicates the success or > failure of the operator on the right, since the binding operator doesn't > really do anything on its own." greetings joe >[...] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>