Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Use cases for 'sub Pckg::func { }' ?

by jo37 (Deacon)
on Aug 01, 2020 at 07:02 UTC ( [id://11120175]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Use cases for 'sub Pckg::func { }' ?
in thread Use cases for 'sub Pckg::func { }' ?

I confess.

But seriously, why would I be punished for such:

#!/usr/bin/perl use strict; use warnings; use LinkedList::Single; sub format_node_data { my ($id, $name) = @{$_[0]}; "[id:$id, name:$name]"; } sub LinkedList::Single::print { my $list = (shift)->clone; for ($list->head; $list->has_next; $list->next) { print format_node_data($list->node_data), " -> "; } print format_node_data($list->node_data), "\n"; } my $list = LinkedList::Single->new([1, 'foo'], [2, 'bar'], [3, 'baz']) +; $list->print; __DATA__ [id:1, name:foo] -> [id:2, name:bar] -> [id:3, name:baz]

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-18 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found