Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^5: Stuck in Perl.. Partial code, but it needs more improvement.. Any suggestions, please?

by LanX (Sage)
on Jun 04, 2021 at 12:30 UTC ( #11133505=note: print w/replies, xml ) Need Help??


in reply to Re^4: Stuck in Perl.. Partial code, but it needs more improvement.. Any suggestions, please?
in thread Stuck in Perl.. Partial code, but it needs more improvement.. Any suggestions, please?

I always use or in such situations, and I dislike perldocs which do otherwise, because these are invitations for refactoring problems.

Personally I use || only in

  • in arithmetic expressions $x = $y || $z
  • to override false defaults were $x ||= $y

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

update

swapped $a, $b with $y,$z to appease hippo ;-)

  • Comment on Re^5: Stuck in Perl.. Partial code, but it needs more improvement.. Any suggestions, please?
  • Select or Download Code

Replies are listed 'Best First'.
Re^6: Stuck in Perl.. Partial code, but it needs more improvement.. Any suggestions, please?
by hippo (Bishop) on Jun 04, 2021 at 12:44 UTC
    I always use or in such situations, and I dislike perldocs which do otherwise

    So do I. I also dislike the use of $a and $b in docs as metasyntactic variables as they are subsequently used in cargo-culted code and become the cause of errors. There are, after all, plenty of others to choose from.


    🦛

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133505]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2021-12-05 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?