Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: any replacements for smartmatch on comparing two arrays

by CountZero (Bishop)
on Sep 24, 2015 at 16:48 UTC ( [id://1142936]=note: print w/replies, xml ) Need Help??


in reply to Re^2: any replacements for smartmatch on comparing two arrays
in thread any replacements for smartmatch on comparing two arrays

You can always "inspire" yourself by looking at the source of List::Compare or Data::Compare and then include their code bodily into your script.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^4: any replacements for smartmatch on comparing two arrays
by stevieb (Canon) on Sep 24, 2015 at 17:08 UTC

    I just tested this with Data::Compare. To use the Compare function, all that is required is appending the Compare sub contents from the Data::Compare source into the script following this required code (note that both Carp and Scalar::Util have been in core since pre-5.8).

    use warnings; use strict; use Carp; use Scalar::Util; my (%been_there, %handler); print Compare([], [qw(1 2)]);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-03-28 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found