G'day renjoooz,

Welcome to the monastery.

The special variable $` is not a good choice. I recommend you avoid using it whenever possible. Here's an extract of what perlvar has to say about it:

"The use of this variable anywhere in a program imposes a considerable performance penalty on all regular expression matches. ..."

Here's a script (pm_brace_extract.pl) that gives the required output with the input you provided.

#!/usr/bin/env perl use 5.010; use strict; use warnings; while (<DATA>) { my @caught = /\{([^}]+)/g; next unless @caught; say for @caught; } __DATA__ ................... ................... <CMD> windowSelect 444.235666.5542.2656565.1255 <CMD> spaceObject -fixSide bottom -space 0 Spacing instances ... Adding vertical channel spacing of 0.0000um between the following selected instances/modules: {dupe_core/pads/tran_w_1} {dupe_core/pads/tran_w_1} {dupe_core/pads/htran_d_13} {dupe_core/pads/rec_p_14} {dup/pads/VDD_ight1} {dup/pa/GND_g} {dummy_core/pads/dummy_dig22} {dupe_core/pads/dummy_dig23} {dupe_core/pads/comp_pad1} {dupe_core/pad/CORE_vdd1} <CMD> deselectAll <CMD> selectInst dummy_core/pads/IO_gnd_right18 <CMD> selectInst dummy_core/pads/IO_vdd_right18 <CMD> uiSetTool move5 .............. ............... ....................

Output:

$ pm_brace_extract.pl dupe_core/pads/tran_w_1 dupe_core/pads/tran_w_1 dupe_core/pads/htran_d_13 dupe_core/pads/rec_p_14 dup/pads/VDD_ight1 dup/pa/GND_g dummy_core/pads/dummy_dig22 dupe_core/pads/dummy_dig23 dupe_core/pads/comp_pad1 dupe_core/pad/CORE_vdd1

-- Ken


In reply to Re: Perl Log file extraction help required by kcott
in thread Perl Log file extraction help required by renjoooz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.