Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: Basic Coding Tips: Parsimonious Parameterization

by Tanktalus (Canon)
on Jan 29, 2005 at 05:09 UTC ( #426189=note: print w/replies, xml ) Need Help??

in reply to Re^2: Basic Coding Tips: Parsimonious Parameterization
in thread Basic Coding Tips: Parsimonious Parameterization

I have to admit - he couldn't do it much faster than that and still have a subroutine...

(Anyone else notice that @array2 will always be empty since @array1 will get all of @_? Thus, the foreach will always be skipped!)

  • Comment on Re^3: Basic Coding Tips: Parsimonious Parameterization

Replies are listed 'Best First'.
Re^4: Basic Coding Tips: Parsimonious Parameterization
by wazoox (Prior) on Jan 31, 2005 at 12:37 UTC
    Yes :) But it'd works this way:
    sub array_merge(\@\@){ my($array1, $array2) = @_; foreach my $element (@$array2){ @$array1 = (@$array1, $element); }#foreach return @$array1; }#array_merge my @t=array_merge(@liste1, @liste2);
      my @t = (@liste1, @liste2);
      works too. No need to reinvent what the core language already provides in a simple way.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://426189]
Corion discovers a new shiny toy to try out over the (longish) weekend. Since I've done some more with websockets, maybe I'll try writing a webserver that implements hot-reloading of HTML(+CSS, +Javascript) in the browser. Edit the local file and ...
[Corion]: ... the browser(s) get a ping to a) refresh the page or b) reload "just" the changed parts, keeping the scroll position etc.
[Corion]: But I also have to look at how I can make WWW::Mechanize:: RemoteBrowser a reality, and how to make it safe from malicious content ;)
[Corion]: Part of wanting hot-reloading is that I think I've stumbled on a very simple set of CSS that I maybe want to use for a blog, but I want to try that out on mobile too, and I also want to add/modify it slightly so it has a header too...
[Corion]: ... and having hot reloading would make it easy to view the changes in multiple browser windows of different sizes, and on Android, simultaneously

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2018-04-26 10:49 GMT
Find Nodes?
    Voting Booth?