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

Re: string minuplate

by gav^ (Curate)
on Jun 26, 2002 at 00:34 UTC ( #177247=note: print w/replies, xml ) Need Help??

in reply to string manipulate

If I understand you correctly, something like this should do the trick:
my @flags = (); while (<DATA>) { push @flags, /(-D\S+)/g; } use Data::Dump qw(dump); print dump(\@flags); __DATA__ -D__c_plusplus=1 -D__cplusplus=1 \ -D__NAMESPACES -D__STANDARD_CXX \ -D__ghs -Dghs -D__SoftwareFloat \ -D__m68k -Dm68k -D__mc68000 \ -D__m68ec060 -Dm68ec060 __END__ Result: [ "-D__c_plusplus=1", "-D__cplusplus=1", "-D__NAMESPACES", "-D__STANDARD_CXX", "-D__ghs", "-Dghs", "-D__SoftwareFloat", "-D__m68k", "-Dm68k", "-D__mc68000", "-D__m68ec060", "-Dm68ec060", ]
It would help if your question was a little less vague and you provided some sample output :)


Replies are listed 'Best First'.
Re: Re: string minuplate
by amoura (Initiate) on Jun 26, 2002 at 14:49 UTC
    Dear gav^ , here is a sample output :
    -D__PROTOTYPES__ -D__STDC__=0 -D__c_plusplus=1 -D__cplusplus=1 \ -D__LANGUAGE_CXX -D__LANGUAGE_CXX__ -D__NAMESPACES -D__STANDARD_CX +X \ -D__STANDARD_CXX_HEADERS -D__ghs__ -D__ghs -Dghs -D__SoftwareFloat + \ -D__SoftwareDouble -D__COFF -D__m68k__ -D__m68k -Dm68k -D__mc68000 + \ -Dmc68000 -D__MC68000 -DMC68000 -D__motcoff -D__m68ec060 -Dm68ec06 +0 \ -D__ghs_alignment=4 -D__BigEndian -DBigEndian -D__DOUBLE_HL \ -D__IeeeFloat -DIeeeFloat -D__Ptr_Is_Signed__ -D__Char_Is_Signed__ + \ -D__SIGNED_CHARS__ -D__WChar_Is_Signed__ -D__WChar_Is_Long__ \ -D__Int_Is_32 -D__Long_Is_32 -D__Ptr_Is_32 -D__Reg_Is_32 \ -DSEL_AIS_TARGET -DAIS_BUILD -DINCLUDE_XDM_SWERR -DXDM_ON \ -DXDM_DIRECT -DXDM_SYNC -DTARGET_PROTO \ -DACN_SUPPORTS_SIGNALING_SERVICES -DGH_DEBUG \ -DACN_SUPPORTS_TRAFFIC_SERVICES -DPIMTUNE_ACN_APP -DNOIS_USES_CCLH +C \ -DACL_SUPPORTS_STREAMS -DPIM_PFB -DESELVER_NTGB06CA -DSELREV_X2 \ -DTARGET_ESEL -DLOG_VOCODER_STATS -DOFP_SUPPORTED -DDEBUG \ -DSRM_DEBUG_TURN_ON -D_GH -DTARGET_060 -DMEMMONITOR \
    It looks bad sorry, but do you know of any other way , I can get rid of the "\" at the end of each line without using Data:Dump thanks much

    Edit: Added <code> tags. larsen

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://177247]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2017-02-22 20:54 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (335 votes). Check out past polls.