in reply to Split on . (dot)
As a beginner now would be a good time to learn to use strict and warnings (-w flag after shebang). These are handy tools for debugging your future scripts.#!/usr/bin/perl -w use strict; my $ip = "192.168.2.34"; my @t = split(/\./, $ip); my $x = @t; print "Number of elements in array: $x\n"; print "Content of array: @t\n";
update: changed text slightly because the node got retitled.
|
|---|